|
| 1 | +import { fixupPluginRules } from '@eslint/compat' |
| 2 | +import { FlatCompat } from '@eslint/eslintrc' |
| 3 | +import js from '@eslint/js' |
| 4 | +import typescriptEslint from '@typescript-eslint/eslint-plugin' |
| 5 | +import tsParser from '@typescript-eslint/parser' |
| 6 | +import _import from 'eslint-plugin-import' |
| 7 | +import jest from 'eslint-plugin-jest' |
| 8 | +import prettier from 'eslint-plugin-prettier' |
| 9 | +import globals from 'globals' |
| 10 | +import path from 'node:path' |
| 11 | +import { fileURLToPath } from 'node:url' |
| 12 | + |
| 13 | +const __filename = fileURLToPath(import.meta.url) |
| 14 | +const __dirname = path.dirname(__filename) |
| 15 | +const compat = new FlatCompat({ |
| 16 | + baseDirectory: __dirname, |
| 17 | + recommendedConfig: js.configs.recommended, |
| 18 | + allConfig: js.configs.all |
| 19 | +}) |
| 20 | + |
| 21 | +export default [ |
| 22 | + { |
| 23 | + ignores: ['**/coverage', '**/dist', '**/linter', '**/node_modules'] |
| 24 | + }, |
| 25 | + ...compat.extends( |
| 26 | + 'eslint:recommended', |
| 27 | + 'plugin:@typescript-eslint/eslint-recommended', |
| 28 | + 'plugin:@typescript-eslint/recommended', |
| 29 | + 'plugin:jest/recommended', |
| 30 | + 'plugin:prettier/recommended' |
| 31 | + ), |
| 32 | + { |
| 33 | + plugins: { |
| 34 | + import: fixupPluginRules(_import), |
| 35 | + jest, |
| 36 | + prettier, |
| 37 | + '@typescript-eslint': typescriptEslint |
| 38 | + }, |
| 39 | + |
| 40 | + languageOptions: { |
| 41 | + globals: { |
| 42 | + ...globals.node, |
| 43 | + ...globals.jest, |
| 44 | + Atomics: 'readonly', |
| 45 | + SharedArrayBuffer: 'readonly' |
| 46 | + }, |
| 47 | + |
| 48 | + parser: tsParser, |
| 49 | + ecmaVersion: 2023, |
| 50 | + sourceType: 'module', |
| 51 | + |
| 52 | + parserOptions: { |
| 53 | + project: ['tsconfig.eslint.json'], |
| 54 | + tsconfigRootDir: '.' |
| 55 | + } |
| 56 | + }, |
| 57 | + |
| 58 | + settings: { |
| 59 | + 'import/resolver': { |
| 60 | + typescript: { |
| 61 | + alwaysTryTypes: true, |
| 62 | + project: 'tsconfig.eslint.json' |
| 63 | + } |
| 64 | + } |
| 65 | + }, |
| 66 | + |
| 67 | + rules: { |
| 68 | + camelcase: 'off', |
| 69 | + 'eslint-comments/no-use': 'off', |
| 70 | + 'eslint-comments/no-unused-disable': 'off', |
| 71 | + 'i18n-text/no-en': 'off', |
| 72 | + 'import/no-namespace': 'off', |
| 73 | + 'no-console': 'off', |
| 74 | + 'no-shadow': 'off', |
| 75 | + 'no-unused-vars': 'off', |
| 76 | + 'prettier/prettier': 'error' |
| 77 | + } |
| 78 | + } |
| 79 | +] |
0 commit comments