Skip to content

Commit a134eaf

Browse files
chore: use eslint builtin typescript config file support (#591)
1 parent 4c4de23 commit a134eaf

File tree

5 files changed

+197
-384
lines changed

5 files changed

+197
-384
lines changed

.eslintignore

-9
This file was deleted.

.vscode/settings.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
2-
"eslint.experimental.useFlatConfig": true,
2+
"eslint.useFlatConfig": true,
3+
"eslint.options": {
4+
"flags": [
5+
"unstable_ts_config"
6+
]
7+
},
38
"prettier.enable": false,
49
"editor.codeActionsOnSave": {
510
"source.fixAll": "explicit"

eslint.config.ts

+16-6
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,25 @@ export default antfu({
2828
'ts/ban-types': 'off',
2929
'ts/no-unused-expressions': 'off',
3030
'ts/no-unsafe-function-type': 'off',
31+
32+
'unicorn/consistent-function-scoping': 'off',
3133
},
3234
}, {
3335
files: ['packages/devtools-kit/**/*.ts'],
34-
plugins: {
35-
devtools,
36-
},
36+
plugins: { devtools },
3737
rules: {
38-
'devtools/no-vue-runtime-import': ['error', {
39-
prefer: 'shared/stub-vue',
40-
}],
38+
'devtools/no-vue-runtime-import': ['error', { prefer: 'shared/stub-vue' }],
4139
},
40+
}, {
41+
ignores: [
42+
'dist',
43+
'node_modules',
44+
'ci.yml',
45+
'release.yml',
46+
'**.svg',
47+
'packages/chrome-extension/overlay/*',
48+
'packages/vite/src/overlay/*',
49+
'packages/chrome-extension/client/*',
50+
'eslint.config.js',
51+
],
4252
})

package.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
"prepare:type": "turbo prepare:type --filter='./packages/*'",
5151
"dev": "NODE_OPTIONS=\"--max-old-space-size=8192\" nr prepare:type && nr build:ui && turbo stub --concurrency 20",
5252
"build": "turbo build",
53-
"lint": "eslint .",
54-
"lint:fix": "eslint . --fix",
53+
"lint": "NODE_OPTIONS=--import=tsx eslint --config=eslint.config.ts .",
54+
"lint:fix": "pnpm lint --fix",
5555
"lint:packages": "pnpm -r --filter='./packages/{core,devtools,devtools-api,devtools-kit,electron,shared,applet}' exec publint && pnpm -r --filter='./packages/{core,devtools,devtools-api,devtools-kit,electron,shared,applet}' exec attw --pack",
5656
"prepublishOnly": "npm run build",
5757
"release": "bumpp && nr build && pnpm -r publish --access public",
@@ -72,7 +72,7 @@
7272
"gen:vue-apis": "tsx ./scripts/vue-api-manifest.ts"
7373
},
7474
"devDependencies": {
75-
"@antfu/eslint-config": "2.27.3",
75+
"@antfu/eslint-config": "^3.0.0",
7676
"@antfu/ni": "^0.23.0",
7777
"@arethetypeswrong/cli": "^0.15.4",
7878
"@clack/prompts": "^0.7.0",
@@ -90,9 +90,8 @@
9090
"bumpp": "^9.5.2",
9191
"cross-env": "^7.0.3",
9292
"degit": "^2.8.4",
93-
"eslint": "npm:[email protected]",
93+
"eslint": "^9.9.1",
9494
"eslint-plugin-format": "^0.1.2",
95-
"eslint-ts-patch": "8.57.0-0",
9695
"eslint-vitest-rule-tester": "^0.6.1",
9796
"execa": "^8.0.1",
9897
"fast-glob": "^3.3.2",
@@ -110,7 +109,7 @@
110109
"simple-git-hooks": "^2.11.1",
111110
"taze": "^0.16.7",
112111
"tsup": "^8.2.4",
113-
"tsx": "^4.18.0",
112+
"tsx": "^4.19.0",
114113
"turbo": "^2.0.14",
115114
"typescript": "^5.5.4",
116115
"unbuild": "^2.0.0",
@@ -123,6 +122,6 @@
123122
"pre-commit": "pnpm lint-staged"
124123
},
125124
"lint-staged": {
126-
"*": "eslint --fix"
125+
"*": "pnpm lint:fix"
127126
}
128127
}

0 commit comments

Comments
 (0)