mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-08 09:53:24 +00:00
a01f0256a1
The upgrade introduced around 50 new linting errors. Fix the low-hanging fruit and address straightforward violations. Several of the new rules appear to target patterns intended for newer React compiler capabilities. Since the project currently runs on React 18 rather than React 19, disable these rules for now instead of applying potentially inappropriate changes. Follow-up work can address the new rules in a dedicated PR, potentially alongside a future React version upgrade.
86 lines
2.2 KiB
JavaScript
86 lines
2.2 KiB
JavaScript
// 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 },
|
|
],
|
|
|
|
// React Compiler rules (v7+) — disable until migrated to React 19
|
|
'react-hooks/react-compiler': 'off',
|
|
'react-hooks/set-state-in-effect': 'off',
|
|
'react-hooks/preserve-manual-memoization': 'off',
|
|
'react-hooks/immutability': 'off',
|
|
'react-hooks/refs': 'off',
|
|
|
|
// 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,
|
|
},
|
|
},
|
|
}
|
|
)
|