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, { // 说明:当前仓库存在大量历史代码与第三方/生成代码。 // 为避免 ESLint 在生产构建阶段被“风格型规则”阻塞,这里将部分规则从 error 降级为 warning。 name: "mnote-lint-overrides", rules: { "@typescript-eslint/no-this-alias": "warn", "@typescript-eslint/no-explicit-any": "warn", "@typescript-eslint/no-require-imports": "warn", "react-hooks/set-state-in-effect": "warn", }, }, // Override default ignores of eslint-config-next. globalIgnores([ // Default ignores of eslint-config-next: ".next/**", "out/**", "build/**", "next-env.d.ts", // 说明:静态资源/第三方构建产物不参与 lint(否则会产生大量无意义报错)。 "public/luckysheet/**", // 说明:Convex 生成代码不参与 lint。 "convex/_generated/**", ]), ]); export default eslintConfig;