diff --git a/.eslintrc.js b/.eslintrc.js index f839b97..94ef2c1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,37 +1,8 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint', 'unused-imports'], - parserOptions: { - project: ['./packages/**/tsconfig.json', './theatre/**/tsconfig.json'], - }, + plugins: ['unused-imports'], extends: [], rules: { - '@typescript-eslint/await-thenable': 'warn', - '@typescript-eslint/no-throw-literal': 'warn', - '@typescript-eslint/switch-exhaustiveness-check': 'error', - '@typescript-eslint/consistent-type-imports': [ - 'warn', - { - prefer: 'type-imports', - }, - ], - '@typescript-eslint/ban-types': [ - 'error', - { - extendDefaults: true, - types: { - any: { - message: - "Don't use any. Use $FixMe or another alternative listed at defs.d.ts", - fixWith: '$FixMe', - }, - '{}': false, - object: false, - }, - }, - ], - '@typescript-eslint/no-unused-vars': 'off', 'unused-imports/no-unused-imports-ts': 'warn', 'no-restricted-imports': [ 'error', @@ -45,4 +16,35 @@ module.exports = { }, ], }, + ignorePatterns: ['*.d.ts'], + overrides: [ + { + files: ['*.ts', '*.tsx'], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + parserOptions: { + project: ['./packages/**/tsconfig.json', './theatre/**/tsconfig.json'], + }, + rules: { + '@typescript-eslint/await-thenable': 'warn', + '@typescript-eslint/no-throw-literal': 'warn', + '@typescript-eslint/switch-exhaustiveness-check': 'error', + '@typescript-eslint/consistent-type-imports': [ + 'warn', + { + prefer: 'type-imports', + }, + ], + '@typescript-eslint/no-unused-vars': 'off', + }, + }, + { + files: ['*.mjs', '*.js'], + parser: 'espree', + parserOptions: { + sourceType: 'module', + ecmaVersion: 2021, + }, + }, + ], }