70 lines
1.9 KiB
JavaScript
70 lines
1.9 KiB
JavaScript
import { defineConfig, globalIgnores } from "eslint/config";
|
|
import nextVitals from "eslint-config-next/core-web-vitals";
|
|
import nextTs from "eslint-config-next/typescript";
|
|
|
|
const reactCompilerRules = [
|
|
"react-hooks/hooks",
|
|
"react-hooks/capitalized-calls",
|
|
"react-hooks/static-components",
|
|
"react-hooks/use-memo",
|
|
"react-hooks/void-use-memo",
|
|
"react-hooks/preserve-manual-memoization",
|
|
"react-hooks/memo-dependencies",
|
|
"react-hooks/incompatible-library",
|
|
"react-hooks/immutability",
|
|
"react-hooks/globals",
|
|
"react-hooks/refs",
|
|
"react-hooks/memoized-effect-dependencies",
|
|
"react-hooks/exhaustive-effect-dependencies",
|
|
"react-hooks/set-state-in-effect",
|
|
"react-hooks/no-deriving-state-in-effects",
|
|
"react-hooks/error-boundaries",
|
|
"react-hooks/purity",
|
|
"react-hooks/set-state-in-render",
|
|
"react-hooks/invariant",
|
|
"react-hooks/todo",
|
|
"react-hooks/syntax",
|
|
"react-hooks/unsupported-syntax",
|
|
"react-hooks/config",
|
|
"react-hooks/gating",
|
|
"react-hooks/rule-suppression",
|
|
"react-hooks/fbt",
|
|
"react-hooks/component-hook-factories",
|
|
];
|
|
|
|
const disabledCompilerRules = Object.fromEntries(
|
|
reactCompilerRules.map((r) => [r, "off"])
|
|
);
|
|
|
|
const eslintConfig = defineConfig([
|
|
...nextVitals,
|
|
...nextTs,
|
|
globalIgnores([
|
|
".next/**",
|
|
".venv-i18n/**",
|
|
"out/**",
|
|
"build/**",
|
|
"next-env.d.ts",
|
|
"scripts/**",
|
|
"prisma/**",
|
|
"socket-server.ts",
|
|
"tests/**",
|
|
]),
|
|
{
|
|
rules: {
|
|
...disabledCompilerRules,
|
|
"react-hooks/exhaustive-deps": "off",
|
|
"react-hooks/rules-of-hooks": "error",
|
|
"@typescript-eslint/no-unused-vars": "off",
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
"react/no-unescaped-entities": "off",
|
|
"@next/next/no-img-element": "off",
|
|
"jsx-a11y/role-has-required-aria-props": "off",
|
|
"@typescript-eslint/no-unused-expressions": "off",
|
|
"prefer-const": "error",
|
|
},
|
|
},
|
|
]);
|
|
|
|
export default eslintConfig;
|