35 lines
956 B
JavaScript
35 lines
956 B
JavaScript
import { defineConfig, globalIgnores } from "eslint/config";
|
|
import nextVitals from "eslint-config-next/core-web-vitals";
|
|
import nextTs from "eslint-config-next/typescript";
|
|
import tanstackQuery from "@tanstack/eslint-plugin-query";
|
|
import drizzle from "eslint-plugin-drizzle";
|
|
|
|
const eslintConfig = defineConfig([
|
|
...nextVitals,
|
|
...nextTs,
|
|
|
|
{
|
|
plugins: {
|
|
"@tanstack/query": tanstackQuery
|
|
},
|
|
rules: {
|
|
...tanstackQuery.configs["flat/recommended"].rules
|
|
}
|
|
},
|
|
|
|
{
|
|
// 该插件仅提供传统配置,flat config 下手动注册;限定 db 对象避免误报其他 update/delete 方法
|
|
plugins: {
|
|
drizzle
|
|
},
|
|
rules: {
|
|
"drizzle/enforce-delete-with-where": ["error", { drizzleObjectName: ["db"] }],
|
|
"drizzle/enforce-update-with-where": ["error", { drizzleObjectName: ["db"] }]
|
|
}
|
|
},
|
|
|
|
globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts"])
|
|
]);
|
|
|
|
export default eslintConfig;
|