Skip to content

Commit 583feae

Browse files
committed
chore: 更新eslint相关依赖并作兼容处理
1 parent 92cfa97 commit 583feae

File tree

23 files changed

+210
-192
lines changed

23 files changed

+210
-192
lines changed

Diff for: eslint.config.js

+11-22
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import js from "@eslint/js";
2+
import tseslint from "typescript-eslint";
23
import pluginVue from "eslint-plugin-vue";
34
import * as parserVue from "vue-eslint-parser";
45
import configPrettier from "eslint-config-prettier";
56
import pluginPrettier from "eslint-plugin-prettier";
67
import { defineConfig, globalIgnores } from "eslint/config";
7-
import * as parserTypeScript from "@typescript-eslint/parser";
8-
import pluginTypeScript from "@typescript-eslint/eslint-plugin";
98

109
export default defineConfig([
1110
globalIgnores([
@@ -20,7 +19,7 @@ export default defineConfig([
2019
...js.configs.recommended,
2120
languageOptions: {
2221
globals: {
23-
// index.d.ts
22+
// types/index.d.ts
2423
RefType: "readonly",
2524
EmitType: "readonly",
2625
TargetContext: "readonly",
@@ -73,21 +72,10 @@ export default defineConfig([
7372
]
7473
}
7574
},
76-
{
75+
...tseslint.config({
76+
extends: [...tseslint.configs.recommended],
7777
files: ["**/*.?([cm])ts", "**/*.?([cm])tsx"],
78-
languageOptions: {
79-
parser: parserTypeScript,
80-
parserOptions: {
81-
sourceType: "module",
82-
warnOnUnsupportedTypeScriptVersion: false
83-
}
84-
},
85-
plugins: {
86-
"@typescript-eslint": pluginTypeScript
87-
},
8878
rules: {
89-
...pluginTypeScript.configs.strict.rules,
90-
"@typescript-eslint/ban-types": "off",
9179
"@typescript-eslint/no-redeclare": "error",
9280
"@typescript-eslint/ban-ts-comment": "off",
9381
"@typescript-eslint/no-explicit-any": "off",
@@ -114,20 +102,20 @@ export default defineConfig([
114102
}
115103
]
116104
}
117-
},
105+
}),
118106
{
119107
files: ["**/*.d.ts"],
120108
rules: {
121109
"eslint-comments/no-unlimited-disable": "off",
122110
"import/no-duplicates": "off",
111+
"no-restricted-syntax": "off",
123112
"unused-imports/no-unused-vars": "off"
124113
}
125114
},
126115
{
127116
files: ["**/*.?([cm])js"],
128117
rules: {
129-
"@typescript-eslint/no-require-imports": "off",
130-
"@typescript-eslint/no-var-requires": "off"
118+
"@typescript-eslint/no-require-imports": "off"
131119
}
132120
},
133121
{
@@ -148,18 +136,19 @@ export default defineConfig([
148136
jsx: true
149137
},
150138
extraFileExtensions: [".vue"],
151-
parser: "@typescript-eslint/parser",
139+
parser: tseslint.parser,
152140
sourceType: "module"
153141
}
154142
},
155143
plugins: {
144+
"@typescript-eslint": tseslint.plugin,
156145
vue: pluginVue
157146
},
158147
processor: pluginVue.processors[".vue"],
159148
rules: {
160149
...pluginVue.configs.base.rules,
161-
...pluginVue.configs["vue3-essential"].rules,
162-
...pluginVue.configs["vue3-recommended"].rules,
150+
...pluginVue.configs.essential.rules,
151+
...pluginVue.configs.recommended.rules,
163152
"no-undef": "off",
164153
"no-unused-vars": "off",
165154
"vue/no-v-html": "off",

Diff for: mock/mine.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default defineFakeRoute([
2525
url: "/mine-logs",
2626
method: "get",
2727
response: () => {
28-
let list = [
28+
const list = [
2929
{
3030
id: 1,
3131
ip: faker.internet.ipv4(),

Diff for: package.json

+8-13
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"@commitlint/cli": "^19.7.1",
118118
"@commitlint/config-conventional": "^19.7.1",
119119
"@commitlint/types": "^19.5.0",
120-
"@eslint/js": "^9.20.0",
120+
"@eslint/js": "^9.24.0",
121121
"@faker-js/faker": "^9.5.0",
122122
"@iconify/json": "^2.2.319",
123123
"@iconify/vue": "4.2.0",
@@ -132,19 +132,17 @@
132132
"@types/qrcode": "^1.5.5",
133133
"@types/qs": "^6.9.18",
134134
"@types/sortablejs": "^1.15.8",
135-
"@typescript-eslint/eslint-plugin": "^8.24.0",
136-
"@typescript-eslint/parser": "^8.24.0",
137135
"@vitejs/plugin-vue": "^5.2.1",
138136
"@vitejs/plugin-vue-jsx": "^4.1.1",
139137
"autoprefixer": "^10.4.20",
140138
"boxen": "^8.0.1",
141139
"code-inspector-plugin": "^0.20.0",
142140
"cssnano": "^7.0.6",
143141
"dagre": "^0.8.5",
144-
"eslint": "^9.23.0",
145-
"eslint-config-prettier": "^10.0.1",
146-
"eslint-plugin-prettier": "^5.2.3",
147-
"eslint-plugin-vue": "^9.32.0",
142+
"eslint": "^9.24.0",
143+
"eslint-config-prettier": "^10.1.1",
144+
"eslint-plugin-prettier": "^5.2.6",
145+
"eslint-plugin-vue": "^10.0.0",
148146
"gradient-string": "^3.0.0",
149147
"husky": "^9.1.7",
150148
"lint-staged": "^15.4.3",
@@ -164,6 +162,7 @@
164162
"svgo": "^3.3.2",
165163
"tailwindcss": "3.4.17",
166164
"typescript": "^5.7.3",
165+
"typescript-eslint": "^8.29.1",
167166
"unplugin-icons": "^22.1.0",
168167
"vite": "^6.1.0",
169168
"vite-plugin-cdn-import": "^1.0.1",
@@ -172,7 +171,7 @@
172171
"vite-plugin-remove-console": "^2.2.0",
173172
"vite-plugin-router-warn": "^1.0.0",
174173
"vite-svg-loader": "^5.1.0",
175-
"vue-eslint-parser": "^9.4.3",
174+
"vue-eslint-parser": "^10.1.3",
176175
"vue-tsc": "^2.2.0"
177176
},
178177
"engines": {
@@ -183,6 +182,7 @@
183182
"allowedDeprecatedVersions": {
184183
"are-we-there-yet": "*",
185184
"sourcemap-codec": "*",
185+
"lodash.isequal": "*",
186186
"domexception": "*",
187187
"w3c-hr-time": "*",
188188
"inflight": "*",
@@ -193,11 +193,6 @@
193193
"abab": "*",
194194
"glob": "*"
195195
},
196-
"peerDependencyRules": {
197-
"allowedVersions": {
198-
"eslint": "9"
199-
}
200-
},
201196
"onlyBuiltDependencies": [
202197
"@parcel/watcher",
203198
"core-js",

0 commit comments

Comments
 (0)