|
| 1 | +import { fixupConfigRules } from '@eslint/compat'; |
| 2 | +import tsParser from '@typescript-eslint/parser'; |
| 3 | +import path from 'node:path'; |
| 4 | +import { fileURLToPath } from 'node:url'; |
| 5 | +import js from '@eslint/js'; |
| 6 | +import { FlatCompat } from '@eslint/eslintrc'; |
| 7 | + |
| 8 | +const __filename = fileURLToPath(import.meta.url); |
| 9 | +const __dirname = path.dirname(__filename); |
| 10 | +const compat = new FlatCompat({ |
| 11 | + baseDirectory: __dirname, |
| 12 | + recommendedConfig: js.configs.recommended, |
| 13 | + allConfig: js.configs.all |
| 14 | +}); |
| 15 | + |
| 16 | +export default [{ |
| 17 | + ignores: ['**/dist', '**/.eslintrc.cjs', 'node_modules/**'], |
| 18 | +}, ...fixupConfigRules(compat.extends( |
| 19 | + 'eslint:recommended', |
| 20 | + 'plugin:@typescript-eslint/recommended', |
| 21 | + 'plugin:prettier/recommended', |
| 22 | +)), { |
| 23 | + languageOptions: { |
| 24 | + parser: tsParser, |
| 25 | + }, |
| 26 | + rules: { |
| 27 | + '@typescript-eslint/explicit-function-return-type': ['off'], |
| 28 | + 'eol-last': [ |
| 29 | + 'error', |
| 30 | + 'always', |
| 31 | + ], |
| 32 | + 'object-curly-spacing': [ |
| 33 | + 'error', |
| 34 | + 'always', |
| 35 | + ], |
| 36 | + 'prefer-const': 'warn', |
| 37 | + 'comma-dangle': [ |
| 38 | + 'error', |
| 39 | + { |
| 40 | + 'arrays': 'always-multiline', |
| 41 | + 'objects': 'always-multiline', |
| 42 | + 'imports': 'always-multiline', |
| 43 | + }, |
| 44 | + ], |
| 45 | + }, |
| 46 | + }, |
| 47 | +]; |
0 commit comments