diff --git a/addons/es6-modules.js b/addons/es6-modules.js index 3a2c2fd..5d388a5 100644 --- a/addons/es6-modules.js +++ b/addons/es6-modules.js @@ -11,9 +11,6 @@ module.exports = { // Rule to control usage of strict mode directives // comment: code inside es6 modules is under strict mode by default, so it's not necessary 'strict': [2, 'never'], - // Enforce require() on top-level module scope - // comment: since we are using es6 modules, one will be using import instead of require but we still allow using inline require - 'global-require': 0, // Rule to warn the use of import when the es6-modules addon is activated. // comment: This should be a warning instead of an error because there are still cases when we must use require. 'prefer-import/prefer-import-over-require': 1, diff --git a/addons/jest.js b/addons/jest.js index d949794..c519b0b 100644 --- a/addons/jest.js +++ b/addons/jest.js @@ -34,7 +34,6 @@ module.exports = { }, { 'files': testFilePatterns, 'rules': { - 'global-require': 0, 'prefer-import/prefer-import-over-require': 0, }, }], diff --git a/rules/node.js b/rules/node.js index 87176f5..8a9431a 100644 --- a/rules/node.js +++ b/rules/node.js @@ -7,7 +7,7 @@ module.exports = { // Require return statements after callbacks 'callback-return': 0, // Require require() calls to be placed at top-level module scope - 'global-require': 1, + 'global-require': 0, // Enforces error handling in callbacks 'handle-callback-err': 1, // Disallow require calls to be mixed with regular variable declarations diff --git a/test/__snapshots__/index.spec.js.snap b/test/__snapshots__/index.spec.js.snap index 208c39b..c33bb99 100644 --- a/test/__snapshots__/index.spec.js.snap +++ b/test/__snapshots__/index.spec.js.snap @@ -874,12 +874,6 @@ Array [ exports[`should pass on fixtures/rules/node/node.js 1`] = ` Array [ - Object { - "column": 21, - "line": 20, - "rule": "global-require", - "severity": 1, - }, Object { "column": 5, "line": 27, diff --git a/test/fixtures/rules/node/node.js b/test/fixtures/rules/node/node.js index 91d98d6..5ec6b07 100644 --- a/test/fixtures/rules/node/node.js +++ b/test/fixtures/rules/node/node.js @@ -15,7 +15,7 @@ const fs = require('fs'); // `global-require` - require require() calls to be placed at top-level module scope // --------------------------------------------------------------------- -// Disencouraged +// Not active (function () { const someDep = require('some-dep'); })();