更新安全配置项目

This commit is contained in:
2026-04-18 23:52:15 +08:00
parent 70d3020035
commit 59b3117eb9
7 changed files with 332 additions and 377 deletions
+16 -1
View File
@@ -1,10 +1,25 @@
import { defineConfig, globalIgnores } from "eslint/config";
import {defineConfig, globalIgnores} from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
{
rules: {
// Allow any type
"@typescript-eslint/no-explicit-any": "off",
// Allow unused variables with underscore prefix
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
// Reduce required type annotations
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
// Allow console logs
"no-console": "off",
// Reduce strictness
"react-hooks/exhaustive-deps": "warn",
}
},
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next: