⬆️(frontend) upgrade frontend to ESLint 9

Manually upgrade the frontend codebase to ESLint 9.

Update the linting configuration and related code where required to
maintain compatibility with the new major version.
This commit is contained in:
lebaudantoine
2026-06-03 17:39:51 +02:00
committed by aleb_the_flash
parent 73a7841b96
commit 6ccc9ef0bf
18 changed files with 1696 additions and 775 deletions
+78
View File
@@ -0,0 +1,78 @@
// src/frontend/eslint.config.js
import js from '@eslint/js'
import tseslint from 'typescript-eslint'
import reactPlugin from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import jsxA11y from 'eslint-plugin-jsx-a11y'
import globals from 'globals'
export default tseslint.config(
// Global ignores (replaces .eslintignore)
{
ignores: [
'dist/**',
'node_modules/**',
'coverage/**',
'src/styled-system/**',
],
},
// Base JS recommended rules
js.configs.recommended,
// TypeScript recommended rules (parser + rules bundled together)
...tseslint.configs.recommended,
// React-specific config
{
files: ['**/*.{ts,tsx}'],
plugins: {
react: reactPlugin,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'jsx-a11y': jsxA11y,
},
languageOptions: {
globals: {
...globals.browser,
},
parserOptions: {
ecmaFeatures: { jsx: true },
},
},
settings: {
react: { version: 'detect' },
},
rules: {
// React rules
...reactPlugin.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
'react/react-in-jsx-scope': 'off', // not needed with React 17+
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
// jsx-a11y recommended rules
...jsxA11y.configs.recommended.rules,
// TypeScript rules you may want to adjust
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/no-explicit-any': 'warn',
},
},
// CJS and root-level JS config files (postcss.config.js, etc.)
{
files: ['**/*.cjs', '*.config.js'],
languageOptions: {
globals: {
...globals.node,
},
},
}
)