From 84c5cd6363d8631e10a8d7e7dabaf2e891b104be Mon Sep 17 00:00:00 2001 From: R0m1k3 Date: Thu, 16 Apr 2026 11:27:46 +0200 Subject: [PATCH] =?UTF-8?q?Migre=20eslint=20v8=20=E2=86=92=20v9=20(flat=20?= =?UTF-8?q?config),=20supprime=20les=20d=C3=A9pr=C3=A9ciations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - eslint 8 → 9, @typescript-eslint/* → typescript-eslint (package unifié) - Remplace .eslintrc.json par eslint.config.mjs (backend) et eslint.config.js (frontend) - Ajoute eslint-plugin-react, eslint-plugin-react-hooks, globals (frontend) - Supprime rimraf@3, @humanwhocodes/* qui étaient des deps transitives d'eslint v8 Co-Authored-By: Claude Sonnet 4.6 --- backend/.eslintrc.json | 22 ---------------------- backend/eslint.config.mjs | 16 ++++++++++++++++ backend/package.json | 6 +++--- frontend/.eslintrc.json | 34 ---------------------------------- frontend/eslint.config.js | 34 ++++++++++++++++++++++++++++++++++ frontend/package.json | 9 ++++++--- 6 files changed, 59 insertions(+), 62 deletions(-) delete mode 100644 backend/.eslintrc.json create mode 100644 backend/eslint.config.mjs delete mode 100644 frontend/.eslintrc.json create mode 100644 frontend/eslint.config.js diff --git a/backend/.eslintrc.json b/backend/.eslintrc.json deleted file mode 100644 index 6085503..0000000 --- a/backend/.eslintrc.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "env": { - "node": true, - "es2021": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended" - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "rules": { - "@typescript-eslint/no-unused-vars": "warn", - "@typescript-eslint/no-explicit-any": "warn" - } -} diff --git a/backend/eslint.config.mjs b/backend/eslint.config.mjs new file mode 100644 index 0000000..ac6a21d --- /dev/null +++ b/backend/eslint.config.mjs @@ -0,0 +1,16 @@ +import js from '@eslint/js'; +import tseslint from 'typescript-eslint'; + +export default tseslint.config( + js.configs.recommended, + ...tseslint.configs.recommended, + { + rules: { + '@typescript-eslint/no-unused-vars': 'warn', + '@typescript-eslint/no-explicit-any': 'warn', + }, + }, + { + ignores: ['dist/**', 'node_modules/**'], + } +); diff --git a/backend/package.json b/backend/package.json index 5b607d7..f7dc6ab 100644 --- a/backend/package.json +++ b/backend/package.json @@ -33,9 +33,9 @@ "@types/bcryptjs": "^2.4.2", "typescript": "^5.2.2", "tsx": "^4.1.0", - "eslint": "^8.50.0", - "@typescript-eslint/eslint-plugin": "^6.7.5", - "@typescript-eslint/parser": "^6.7.5", + "eslint": "^9.18.0", + "@eslint/js": "^9.18.0", + "typescript-eslint": "^8.22.0", "vitest": "^0.34.6" } } diff --git a/frontend/.eslintrc.json b/frontend/.eslintrc.json deleted file mode 100644 index 48215bb..0000000 --- a/frontend/.eslintrc.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "env": { - "browser": true, - "es2021": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:react/recommended", - "plugin:react-hooks/recommended" - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaFeatures": { - "jsx": true - }, - "ecmaVersion": "latest", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "react" - ], - "rules": { - "react/react-in-jsx-scope": "off", - "@typescript-eslint/no-unused-vars": "warn", - "@typescript-eslint/no-explicit-any": "warn" - }, - "settings": { - "react": { - "version": "detect" - } - } -} diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js new file mode 100644 index 0000000..90b5b2f --- /dev/null +++ b/frontend/eslint.config.js @@ -0,0 +1,34 @@ +import js from '@eslint/js'; +import tseslint from 'typescript-eslint'; +import reactPlugin from 'eslint-plugin-react'; +import reactHooksPlugin from 'eslint-plugin-react-hooks'; +import globals from 'globals'; + +export default tseslint.config( + js.configs.recommended, + ...tseslint.configs.recommended, + { + plugins: { + react: reactPlugin, + 'react-hooks': reactHooksPlugin, + }, + languageOptions: { + globals: { + ...globals.browser, + }, + }, + rules: { + 'react/react-in-jsx-scope': 'off', + '@typescript-eslint/no-unused-vars': 'warn', + '@typescript-eslint/no-explicit-any': 'warn', + 'react-hooks/rules-of-hooks': 'error', + 'react-hooks/exhaustive-deps': 'warn', + }, + settings: { + react: { version: 'detect' }, + }, + }, + { + ignores: ['dist/**', 'node_modules/**'], + } +); diff --git a/frontend/package.json b/frontend/package.json index 89c71ea..3c0fa66 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -23,11 +23,14 @@ "devDependencies": { "@types/react": "^18.2.28", "@types/react-dom": "^18.2.13", - "@typescript-eslint/eslint-plugin": "^6.7.5", - "@typescript-eslint/parser": "^6.7.5", "@vitejs/plugin-react": "^4.1.0", "autoprefixer": "^10.4.16", - "eslint": "^8.50.0", + "eslint": "^9.18.0", + "@eslint/js": "^9.18.0", + "typescript-eslint": "^8.22.0", + "eslint-plugin-react": "^7.37.0", + "eslint-plugin-react-hooks": "^5.1.0", + "globals": "^15.0.0", "postcss": "^8.4.31", "tailwindcss": "^3.3.3", "typescript": "^5.2.2",