Skip to content

Commit f6ee77f

Browse files
committed
fix: upgrade eslint
1 parent 0545386 commit f6ee77f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

eslint.config.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import next from "eslint-config-next";
2+
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
3+
import nextTypescript from "eslint-config-next/typescript";
14
// eslint.config.mjs ← 推荐直接改成 .mjs,或在 package.json 加 "type":"module"
25
import globals from "globals";
36
import js from "@eslint/js";
@@ -7,6 +10,9 @@ import reactHooks from "eslint-plugin-react-hooks";
710
import unusedImports from "eslint-plugin-unused-imports";
811

912
export default [
13+
...next,
14+
...nextCoreWebVitals,
15+
...nextTypescript,
1016
// 忽略目录(取代 .eslintignore)
1117
{
1218
ignores: [
@@ -26,7 +32,6 @@ export default [
2632
"**/*.min.js",
2733
],
2834
},
29-
3035
// 通用 JS/TS
3136
{
3237
files: ["**/*.{js,jsx,ts,tsx}"],
@@ -53,7 +58,6 @@ export default [
5358
],
5459
},
5560
},
56-
5761
// TypeScript 规则
5862
...tseslint.config({
5963
files: ["**/*.{ts,tsx}"],
@@ -70,7 +74,6 @@ export default [
7074
],
7175
},
7276
}),
73-
7477
// 单文件豁免:Next 自动生成的 d.ts
7578
{
7679
files: ["next-env.d.ts"],

0 commit comments

Comments
 (0)