|
| 1 | +// @ts-check |
| 2 | + |
| 3 | +import globals from 'globals'; |
| 4 | +import eslintJs from '@eslint/js'; |
| 5 | +import eslintTs from 'typescript-eslint'; |
| 6 | +import eslintConfigPrettier from 'eslint-config-prettier'; |
| 7 | + |
| 8 | +/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.Config} */ |
| 9 | +const eslintConfigPrettierTypeForced = (() => { |
| 10 | + /** @type {any} */ |
| 11 | + const eslintConfigPrettierAsAny = eslintConfigPrettier; |
| 12 | + return eslintConfigPrettierAsAny; |
| 13 | +})(); |
| 14 | + |
| 15 | +/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigFile} */ |
| 16 | +export default [ |
| 17 | + eslintJs.configs.recommended, |
| 18 | + ...eslintTs.configs.recommended, |
| 19 | + eslintConfigPrettierTypeForced, |
| 20 | + { |
| 21 | + files: ['**/*.{ts,ts,tsx,js,mjs,jsx}'], |
| 22 | + plugins: {}, |
| 23 | + languageOptions: { |
| 24 | + globals: { ...globals.browser }, |
| 25 | + parser: eslintTs.parser, |
| 26 | + ecmaVersion: 5, |
| 27 | + sourceType: 'script', |
| 28 | + }, |
| 29 | + /** @type {Partial<import("eslint/rules").ESLintRules>} */ |
| 30 | + rules: { |
| 31 | + ['no-shadow']: 'off', |
| 32 | + ['comma-dangle']: 'off', |
| 33 | + ['radix']: 'off', |
| 34 | + ['no-use-before-define']: 'off', |
| 35 | + ['no-constant-condition']: 'off', |
| 36 | + ['no-unused-vars']: 'off', |
| 37 | + ['no-unused-expressions']: 'off', |
| 38 | + ['no-await-in-loop']: 'off', |
| 39 | + ['no-empty']: 'off', |
| 40 | + ['no-continue']: 'off', |
| 41 | + ['require-yield']: 'off', |
| 42 | + ['@typescript-eslint/require-yield']: 'off', |
| 43 | + ['@typescript-eslint/no-explicit-any']: 'off', |
| 44 | + ['@typescript-eslint/no-non-null-assertion']: 'off', |
| 45 | + ['@typescript-eslint/no-empty-function']: 'off', |
| 46 | + ['@typescript-eslint/no-unused-expressions']: 'warn', |
| 47 | + ['@typescript-eslint/no-unused-vars']: [ |
| 48 | + 'warn', |
| 49 | + { |
| 50 | + varsIgnorePattern: '^_', |
| 51 | + argsIgnorePattern: '^_', |
| 52 | + caughtErrorsIgnorePattern: '^_', |
| 53 | + destructuredArrayIgnorePattern: '^_', |
| 54 | + }, |
| 55 | + ], |
| 56 | + }, |
| 57 | + }, |
| 58 | +]; |
0 commit comments