diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 04ecf049ca9..4296d0f39b6 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,3 +1,5 @@ +/* eslint-disable no-restricted-globals */ + const DOMGlobals = ['window', 'document'] const NodeGlobals = ['module', 'require'] @@ -9,12 +11,6 @@ module.exports = { plugins: ['jest'], rules: { 'no-debugger': 'error', - 'no-unused-vars': [ - 'error', - // we are only using this rule to check for unused arguments since TS - // catches unused variables but not args. - { varsIgnorePattern: '.*', args: 'none' } - ], // most of the codebase are expected to be env agnostic 'no-restricted-globals': ['error', ...DOMGlobals, ...NodeGlobals], @@ -72,6 +68,14 @@ module.exports = { 'no-restricted-syntax': 'off' } }, + // JavaScript files + { + files: ['*.js', '*.cjs'], + rules: { + // We only do `no-unused-vars` checks for js files, TS files are checked by TypeScript itself. + 'no-unused-vars': ['error', { vars: 'all', args: 'none' }] + } + }, // Node scripts { files: ['scripts/**', '*.{js,ts}', 'packages/**/index.js'],