diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js index 6bcbcdf2..cecf4b97 100644 --- a/frontend/eslint.config.js +++ b/frontend/eslint.config.js @@ -1,5 +1,6 @@ import js from "@eslint/js"; import stylistic from "@stylistic/eslint-plugin"; +import react from "eslint-plugin-react"; import reactHooks from "eslint-plugin-react-hooks"; import reactRefresh from "eslint-plugin-react-refresh"; import simpleImportSort from "eslint-plugin-simple-import-sort"; @@ -8,7 +9,11 @@ import tseslint from "typescript-eslint"; export default tseslint.config( { ignores: ["dist"] }, { - extends: [js.configs.recommended, ...tseslint.configs.recommendedTypeChecked], + extends: [ + js.configs.recommended, + react.configs.flat.recommended, + ...tseslint.configs.recommendedTypeChecked, + ], files: ["src/**/*.{ts,tsx}"], languageOptions: { parserOptions: { @@ -17,13 +22,14 @@ export default tseslint.config( }, }, plugins: { + "@stylistic": stylistic, "react-hooks": reactHooks, "react-refresh": reactRefresh, "simple-import-sort": simpleImportSort, - "@stylistic": stylistic, }, rules: { ...reactHooks.configs.recommended.rules, + "react/react-in-jsx-scope": "off", "react-refresh/only-export-components": ["warn", { allowConstantExport: true }], // imports @@ -33,7 +39,7 @@ export default tseslint.config( // core "curly": "error", "eqeqeq": "error", - "no-console": "error", + "no-console": ["warn", { allow: ["warn", "error"] }], "no-eval": "error", // stylistic @@ -68,6 +74,7 @@ export default tseslint.config( "@typescript-eslint/consistent-type-imports": ["error", { prefer: "type-imports" }], "@typescript-eslint/explicit-function-return-type": ["error", { allowExpressions: true }], "@typescript-eslint/no-deprecated": "error", + "@typescript-eslint/no-floating-promises": "error", "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }], "@typescript-eslint/prefer-nullish-coalescing": "error", "@typescript-eslint/prefer-optional-chain": "error", diff --git a/frontend/package.json b/frontend/package.json index 81b367a7..44270b28 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -20,6 +20,7 @@ "@types/react-syntax-highlighter": ">=15.5.0 <15.6.0", "@vitejs/plugin-react": ">=6.0.0 <6.1.0", "eslint": ">=9.39.0 <9.40.0", + "eslint-plugin-react": ">=7.37.0 <7.38.0", "eslint-plugin-react-hooks": ">=7.0.0 <7.1.0", "eslint-plugin-react-refresh": ">=0.5.0 <0.6.0", "eslint-plugin-simple-import-sort": ">=12.1.0 <12.2.0", diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 018317b7..5c713440 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -4,18 +4,18 @@ "baseUrl": "src", "isolatedModules": true, "jsx": "react-jsx", - "lib": ["ES2020", "DOM", "DOM.Iterable"], + "lib": ["ESNext", "DOM", "DOM.Iterable"], "module": "ESNext", "moduleResolution": "bundler", "noEmit": true, "noFallthroughCasesInSwitch": true, - "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, "noUnusedLocals": true, "noUnusedParameters": true, "resolveJsonModule": true, "skipLibCheck": true, "strict": true, - "target": "ES2020", + "target": "ESNext", "useDefineForClassFields": true }, "include": ["src"]