diff --git a/addons/es-modules.js b/addons/es-modules.js index 00148c1..a048376 100644 --- a/addons/es-modules.js +++ b/addons/es-modules.js @@ -16,7 +16,7 @@ module.exports = { 'prefer-import/prefer-import-over-require': 1, }, 'overrides': [{ - 'files': '*.config.js', + 'files': './*.config.js', 'rules': { 'prefer-import/prefer-import-over-require': 0, }, diff --git a/test/__snapshots__/index.spec.js.snap b/test/__snapshots__/index.spec.js.snap index c761ac3..b7e285c 100644 --- a/test/__snapshots__/index.spec.js.snap +++ b/test/__snapshots__/index.spec.js.snap @@ -1781,6 +1781,17 @@ Array [ exports[`should pass on fixtures/samples/es6-modules/contrived.good.js 1`] = `Array []`; +exports[`should pass on fixtures/samples/es6-modules/nested/require.config.js 1`] = ` +Array [ + Object { + "column": 14, + "line": 5, + "rule": "prefer-import/prefer-import-over-require", + "severity": 1, + }, +] +`; + exports[`should pass on fixtures/samples/es6-modules/require.config.js 1`] = `Array []`; exports[`should pass on fixtures/samples/es6-modules/require.js 1`] = ` diff --git a/test/fixtures/samples/es6-modules/nested/require.config.js b/test/fixtures/samples/es6-modules/nested/require.config.js new file mode 100644 index 0000000..5c27e10 --- /dev/null +++ b/test/fixtures/samples/es6-modules/nested/require.config.js @@ -0,0 +1,7 @@ +// Made up sample.. not genuine + +// [...].config.js file, should not warn against require + +const test = require('good'); + +console.log(test);