diff --git a/web/eslint.config.mjs b/web/eslint.config.mjs index ff7f0b9..3cd302a 100644 --- a/web/eslint.config.mjs +++ b/web/eslint.config.mjs @@ -3,7 +3,21 @@ import nextVitals from "eslint-config-next/core-web-vitals"; import nextTs from "eslint-config-next/typescript"; const eslintConfig = defineConfig([ - ...nextVitals, + ...nextVitals.map((cfg) => { + // Downgrade React 19 strict rules to warnings (fix incrementally) + if (cfg?.rules?.["react-hooks/rules-of-hooks"]) { + return { + ...cfg, + rules: { + ...cfg.rules, + "react-hooks/rules-of-hooks": "warn", + "react-hooks/set-state-in-effect": "off", + "react-hooks/purity": "warn", + }, + }; + } + return cfg; + }), ...nextTs, // Override default ignores of eslint-config-next. globalIgnores([ @@ -15,10 +29,6 @@ const eslintConfig = defineConfig([ ]), { rules: { - // Downgrade React 19 strict rules to warnings (fix incrementally) - "react-hooks/rules-of-hooks": "warn", - "react-hooks/set-state-in-effect": "off", - "react-hooks/purity": "warn", "@typescript-eslint/no-this-alias": "warn", "@typescript-eslint/no-require-imports": "warn", },