- Add eslint.config.mjs (flat config, eslint-config-next@16 + TypeScript) - Add .gitea/workflows/ci.yaml (lint, test:unit, build on all branches) - Refactor deploy.yaml: needs: [ci] gate, Docker rollback tag, Telegram notifications - Fix 3 pre-existing lint errors (empty interfaces, ts-ignore, require imports)
65 lines
1.7 KiB
JavaScript
65 lines
1.7 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/**",
|
|
"out/**",
|
|
"build/**",
|
|
"next-env.d.ts",
|
|
"scripts/**",
|
|
"prisma/**",
|
|
"socket-server.ts",
|
|
"tests/**",
|
|
]),
|
|
{
|
|
rules: {
|
|
...disabledCompilerRules,
|
|
"react-hooks/exhaustive-deps": "warn",
|
|
"react-hooks/rules-of-hooks": "error",
|
|
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
|
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
"react/no-unescaped-entities": "off",
|
|
},
|
|
},
|
|
]);
|
|
|
|
export default eslintConfig;
|