|
| 1 | +// @ts-check |
| 2 | + |
| 3 | +import eslint from '@eslint/js'; |
| 4 | +import tseslint from 'typescript-eslint'; |
| 5 | +import jestPlugin from 'eslint-plugin-jest'; |
| 6 | +import n from 'eslint-plugin-n'; |
| 7 | + |
| 8 | +const ignores = [ |
| 9 | + '**/*.snap', |
| 10 | + 'coverage', |
| 11 | + 'node_modules', |
| 12 | + 'dist', |
| 13 | + 'build', |
| 14 | + 'lib', |
| 15 | +]; |
| 16 | + |
| 17 | +const tests = ['**/*.spec.{js,ts}']; |
| 18 | + |
| 19 | +export default tseslint.config( |
| 20 | + { |
| 21 | + ignores, |
| 22 | + }, |
| 23 | + { linterOptions: { reportUnusedDisableDirectives: 'error' } }, |
| 24 | + eslint.configs.recommended, |
| 25 | + tseslint.configs.recommended, |
| 26 | + n.configs['flat/recommended'], |
| 27 | + { |
| 28 | + rules: { |
| 29 | + '@typescript-eslint/no-explicit-any': 'off', |
| 30 | + '@typescript-eslint/no-unused-vars': 'off', |
| 31 | + '@typescript-eslint/no-require-imports': 'off', |
| 32 | + 'n/no-missing-import': 'off', |
| 33 | + 'n/no-unsupported-features/node-builtins': 'off', |
| 34 | + }, |
| 35 | + }, |
| 36 | + { |
| 37 | + files: tests, |
| 38 | + extends: [jestPlugin.configs['flat/recommended']], |
| 39 | + rules: { |
| 40 | + 'no-undef': 'off', |
| 41 | + 'jest/no-alias-methods': 'off', |
| 42 | + 'jest/no-identical-title': 'off', |
| 43 | + 'jest/no-disabled-tests': 'off', |
| 44 | + 'jest/no-conditional-expect': 'off', |
| 45 | + 'jest/valid-expect': 'off', |
| 46 | + }, |
| 47 | + }, |
| 48 | +); |
0 commit comments