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",