519fb92c34
Turn on react-hooks/set-state-in-effect and react-hooks/incompatible-library, then remove effect-driven local state sync patterns across affected pages. Keep behavior stable by deriving values from source state, remounting tab state by role key, and replacing useForm watch with useWatch.
44 lines
1.4 KiB
JavaScript
44 lines
1.4 KiB
JavaScript
import { defineConfig, globalIgnores } from "eslint/config"
|
|
import nextVitals from "eslint-config-next/core-web-vitals"
|
|
import nextTypescript from "eslint-config-next/typescript"
|
|
import prettier from "eslint-config-prettier/flat"
|
|
|
|
const eslintConfig = defineConfig([
|
|
...nextVitals,
|
|
...nextTypescript,
|
|
{
|
|
files: ["**/*.{ts,tsx,mts,cts}"],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
projectService: true,
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
rules: {
|
|
"react-hooks/exhaustive-deps": "error",
|
|
"react-hooks/set-state-in-effect": "error",
|
|
"react-hooks/incompatible-library": "error",
|
|
"@next/next/no-async-client-component": "error",
|
|
"@typescript-eslint/no-explicit-any": "error",
|
|
"@typescript-eslint/no-non-null-assertion": "error",
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"warn",
|
|
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
|
],
|
|
"@typescript-eslint/consistent-type-imports": [
|
|
"error",
|
|
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
|
|
],
|
|
"@typescript-eslint/no-floating-promises": "error",
|
|
"@typescript-eslint/no-misused-promises": [
|
|
"error",
|
|
{ checksVoidReturn: { attributes: false } },
|
|
],
|
|
},
|
|
},
|
|
prettier,
|
|
globalIgnores([".next/**", "out/**", "build/**", "node_modules/**", "next-env.d.ts"]),
|
|
])
|
|
|
|
export default eslintConfig
|