+/* eslint-disable no-restricted-globals */
+
const DOMGlobals = ['window', 'document']
const NodeGlobals = ['module', 'require']
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],
'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'],