🔧 chore(eslint): migrate config to v10 standards

This commit is contained in:
2026-05-08 17:58:09 +02:00
parent 8a987e6e39
commit 9bd2b2b723
+10 -24
View File
@@ -1,33 +1,19 @@
import { fixupConfigRules } from '@eslint/compat' import tsPlugin from '@typescript-eslint/eslint-plugin'
import reactRefresh from 'eslint-plugin-react-refresh'
import globals from 'globals'
import tsParser from '@typescript-eslint/parser' import tsParser from '@typescript-eslint/parser'
import path from 'node:path' import reactRefresh from 'eslint-plugin-react-refresh'
import { fileURLToPath } from 'node:url' import reactHooks from 'eslint-plugin-react-hooks'
import globals from 'globals'
import js from '@eslint/js' import js from '@eslint/js'
import { FlatCompat } from '@eslint/eslintrc' import prettierRecommended from 'eslint-plugin-prettier/recommended'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
})
export default [ export default [
{ {
ignores: ['coverage', '**/dist', '**/.eslintrc.cjs', 'eslint.config.mjs', 'public/mockServiceWorker.js'], ignores: ['coverage', '**/dist', '**/.eslintrc.cjs', 'eslint.config.mjs', 'public/mockServiceWorker.js'],
}, },
...fixupConfigRules( js.configs.recommended,
compat.extends( ...tsPlugin.configs['flat/recommended'],
'prettier', reactHooks.configs.flat['recommended-latest'],
'eslint:recommended', prettierRecommended,
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended'
)
),
{ {
plugins: { plugins: {
'react-refresh': reactRefresh, 'react-refresh': reactRefresh,
@@ -44,7 +30,7 @@ export default [
parserOptions: { parserOptions: {
project: ['./tsconfig.json', './tsconfig.base.json'], project: ['./tsconfig.json', './tsconfig.base.json'],
tsconfigRootDir: __dirname, tsconfigRootDir: import.meta.dirname,
}, },
}, },