|
| 1 | +import globals from 'globals'; |
| 2 | +import eslint from '@eslint/js'; |
| 3 | +import tseslint from 'typescript-eslint'; |
| 4 | +import pluginJest from 'eslint-plugin-jest'; |
| 5 | +import json from '@eslint/json'; |
| 6 | +import pluginPromise from 'eslint-plugin-promise'; |
| 7 | + |
| 8 | +export default [ |
| 9 | + { ...eslint.configs.recommended, files: ['src/**/*.{js,mjs,cjs,ts}'] }, |
| 10 | + ...tseslint.configs.recommended, |
| 11 | + // ...tseslint.configs.recommendedTypeChecked, |
| 12 | + // ...tseslint.configs.strict, |
| 13 | + // ...tseslint.configs.stylistic, |
| 14 | + // ...tseslint.configs.strictTypeChecked, |
| 15 | + // ...tseslint.configs.stylisticTypeChecked, |
| 16 | + { |
| 17 | + rules: { |
| 18 | + '@typescript-eslint/no-unused-vars': [ |
| 19 | + 'error', |
| 20 | + { |
| 21 | + args: 'all', |
| 22 | + argsIgnorePattern: '^_', |
| 23 | + caughtErrors: 'all', |
| 24 | + caughtErrorsIgnorePattern: '^_', |
| 25 | + destructuredArrayIgnorePattern: '^_', |
| 26 | + varsIgnorePattern: '^_', |
| 27 | + ignoreRestSiblings: true, |
| 28 | + }, |
| 29 | + ], |
| 30 | + }, |
| 31 | + }, |
| 32 | + pluginPromise.configs['flat/recommended'], |
| 33 | + { |
| 34 | + plugins: { |
| 35 | + json, |
| 36 | + }, |
| 37 | + files: ['**/*.json'], |
| 38 | + language: 'json/json', |
| 39 | + rules: { |
| 40 | + 'json/no-duplicate-keys': 'error', |
| 41 | + }, |
| 42 | + }, |
| 43 | + { |
| 44 | + ...pluginJest.configs['flat/recommended'], |
| 45 | + ...pluginJest.configs['flat/style'], |
| 46 | + files: ['src/__tests__/**/*tests.ts'], |
| 47 | + plugins: { jest: pluginJest }, |
| 48 | + languageOptions: { |
| 49 | + globals: pluginJest.environments.globals.globals, |
| 50 | + }, |
| 51 | + }, |
| 52 | + { |
| 53 | + languageOptions: { |
| 54 | + globals: { |
| 55 | + ...globals.browser, |
| 56 | + ...globals.node, |
| 57 | + ...globals.es2025, |
| 58 | + Atomics: 'readonly', |
| 59 | + SharedArrayBuffer: 'readonly', |
| 60 | + document: 'readonly', |
| 61 | + navigator: 'readonly', |
| 62 | + window: 'readonly', |
| 63 | + }, |
| 64 | + parserOptions: { |
| 65 | + project: './tsconfig.eslint.json', |
| 66 | + tsconfigRootDir: './', |
| 67 | + }, |
| 68 | + }, |
| 69 | + }, |
| 70 | + { |
| 71 | + ignores: ['src/diff2html-templates.*', 'coverage/', 'docs/', 'bundles-out/', 'bundles/', 'lib/', 'lib-esm/'], |
| 72 | + }, |
| 73 | + { |
| 74 | + ...tseslint.configs.disableTypeChecked, |
| 75 | + files: ['**/*.{js,mjs,cjs}'], |
| 76 | + }, |
| 77 | +]; |
0 commit comments