From 0bc2d84b05ada9fbdc5254009a2cdd3c62a5ff29 Mon Sep 17 00:00:00 2001 From: ehmicky Date: Thu, 10 Dec 2020 19:31:43 +0100 Subject: [PATCH] Add `node/global-require` ESLint rule --- .eslintrc.js | 1 - src/methods/index.js | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index f036431..8a0fd60 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, 'unicorn/filename-case': 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')