From 32a011544c5895d52d54cd12bc4787287546d5b3 Mon Sep 17 00:00:00 2001 From: ehmicky Date: Sun, 13 Dec 2020 09:10:45 +0100 Subject: [PATCH] Add `node/global-require` ESLint rule (#224) --- .eslintrc.js | 1 - src/methods/index.js | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5bb921e..4253e17 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -19,7 +19,6 @@ module.exports = { 'fp/no-mutating-methods': 0, 'fp/no-mutation': 0, 'fp/no-this': 0, - 'node/global-require': 0, 'promise/no-callback-in-promise': 0, 'promise/prefer-await-to-callbacks': 0, }, diff --git a/src/methods/index.js b/src/methods/index.js index de87915..20815d0 100644 --- a/src/methods/index.js +++ b/src/methods/index.js @@ -1,5 +1,6 @@ +const nodeFetch = require('node-fetch') // Webpack will sometimes export default exports in different places -const fetch = require('node-fetch').default || require('node-fetch') +const fetch = nodeFetch.default || nodeFetch const { getOperations } = require('../operations')