|
| 1 | +import { FlatCompat } from '@eslint/eslintrc' |
| 2 | +import js from '@eslint/js' |
| 3 | +import typescriptEslint from '@typescript-eslint/eslint-plugin' |
| 4 | +import tsParser from '@typescript-eslint/parser' |
| 5 | +import prettier from 'eslint-plugin-prettier' |
| 6 | +import path from 'node:path' |
| 7 | +import { fileURLToPath } from 'node:url' |
| 8 | + |
| 9 | +const __filename = fileURLToPath(import.meta.url) |
| 10 | +const __dirname = path.dirname(__filename) |
| 11 | +const compat = new FlatCompat({ |
| 12 | + baseDirectory: __dirname, |
| 13 | + recommendedConfig: js.configs.recommended, |
| 14 | + allConfig: js.configs.all, |
| 15 | +}) |
| 16 | + |
| 17 | +export default [ |
| 18 | + { ignores: ['**/node_modules', '**/dist', '**/test', '**/examples'] }, |
| 19 | + ...compat.extends( |
| 20 | + 'eslint:recommended', |
| 21 | + 'plugin:@typescript-eslint/eslint-recommended', |
| 22 | + 'plugin:@typescript-eslint/recommended', |
| 23 | + 'plugin:prettier/recommended', |
| 24 | + ), |
| 25 | + { |
| 26 | + plugins: { '@typescript-eslint': typescriptEslint, prettier }, |
| 27 | + |
| 28 | + languageOptions: { |
| 29 | + parser: tsParser, |
| 30 | + ecmaVersion: 2020, |
| 31 | + sourceType: 'module', |
| 32 | + }, |
| 33 | + |
| 34 | + rules: { |
| 35 | + 'prettier/prettier': 'warn', |
| 36 | + '@typescript-eslint/member-delimiter-style': 'off', |
| 37 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 38 | + '@typescript-eslint/no-use-before-define': 'off', |
| 39 | + }, |
| 40 | + }, |
| 41 | +] |
0 commit comments