Skip to content

Commit 8fccb7b

Browse files
committed
fix: update eslint
1 parent e3824c3 commit 8fccb7b

File tree

13 files changed

+817
-493
lines changed

13 files changed

+817
-493
lines changed

.eslintrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish Package To Npmjs
33
on:
44
push:
55
tags:
6-
- "v*"
6+
- 'v*'
77
workflow_dispatch:
88

99
jobs:
@@ -21,12 +21,12 @@ jobs:
2121
- name: Install pnpm
2222
uses: pnpm/action-setup@v2
2323
with:
24-
version: "8.x"
24+
version: 8.x
2525

2626
- uses: actions/[email protected]
2727
with:
28-
node-version: "16.x"
29-
registry-url: "https://registry.npmjs.org/"
28+
node-version: 16.x
29+
registry-url: 'https://registry.npmjs.org/'
3030
cache: pnpm
3131

3232
- name: ⏳ Install dependencies

.vscode/settings.json

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
11
{
22
"editor.tabSize": 2,
3-
"editor.formatOnSave": true,
3+
// Enable the ESlint flat config support
4+
"eslint.experimental.useFlatConfig": true,
5+
6+
// Disable the default formatter, use eslint instead
7+
"prettier.enable": false,
8+
"editor.formatOnSave": false,
9+
10+
// Auto fix
411
"editor.codeActionsOnSave": {
5-
"source.fixAll.eslint": true
6-
}
12+
"source.fixAll.eslint": "explicit",
13+
"source.organizeImports": "never"
14+
},
15+
16+
// Silent the stylistic rules in you IDE, but still auto fix them
17+
"eslint.rules.customizations": [
18+
{ "rule": "style/*", "severity": "off" },
19+
{ "rule": "format/*", "severity": "off" },
20+
{ "rule": "*-indent", "severity": "off" },
21+
{ "rule": "*-spacing", "severity": "off" },
22+
{ "rule": "*-spaces", "severity": "off" },
23+
{ "rule": "*-order", "severity": "off" },
24+
{ "rule": "*-dangle", "severity": "off" },
25+
{ "rule": "*-newline", "severity": "off" },
26+
{ "rule": "*quotes", "severity": "off" },
27+
{ "rule": "*semi", "severity": "off" }
28+
],
29+
30+
// Enable eslint for all supported languages
31+
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "html", "markdown", "json", "jsonc", "yaml", "toml"]
732
}

eslint.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// @ts-check
2+
const antfu = require('@antfu/eslint-config').default
3+
4+
module.exports = antfu(
5+
{
6+
ignores: [
7+
'test-out/**',
8+
'**/output.js',
9+
],
10+
},
11+
{
12+
files: ['**/fixtures/**/*.js'],
13+
rules: {
14+
'no-console': 'off',
15+
},
16+
},
17+
{
18+
rules: {
19+
'node/prefer-global/process': 'off',
20+
'unicorn/prefer-node-protocol': 'off',
21+
},
22+
},
23+
)

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"dev": "tsup-node --watch src",
7777
"build:fix": "esno scripts/postbuild.ts",
7878
"lint": "eslint .",
79+
"lint:fix": "eslint . --fix",
7980
"play": "npm -C playground run dev",
8081
"prepublishOnly": "npm run build",
8182
"release": "bumpp",
@@ -91,22 +92,22 @@
9192
"webpack": "^4 || ^5"
9293
},
9394
"peerDependenciesMeta": {
94-
"webpack": {
95+
"@nuxt/kit": {
9596
"optional": true
9697
},
97-
"rollup": {
98+
"@nuxt/schema": {
9899
"optional": true
99100
},
100-
"vite": {
101+
"esbuild": {
101102
"optional": true
102103
},
103-
"esbuild": {
104+
"rollup": {
104105
"optional": true
105106
},
106-
"@nuxt/kit": {
107+
"vite": {
107108
"optional": true
108109
},
109-
"@nuxt/schema": {
110+
"webpack": {
110111
"optional": true
111112
}
112113
},
@@ -115,22 +116,22 @@
115116
"unplugin": "^1.4.0"
116117
},
117118
"devDependencies": {
118-
"@antfu/eslint-config": "^0.40.2",
119+
"@antfu/eslint-config": "^2.6.1",
119120
"@nuxt/kit": "^3.6.5",
120121
"@nuxt/schema": "^3.6.5",
121122
"@types/node": "^20.5.2",
122123
"bumpp": "^9.2.0",
123124
"chalk": "^5.3.0",
124-
"eslint": "^8.47.0",
125+
"eslint": "^8.56.0",
125126
"esno": "^0.17.0",
127+
"fast-glob": "^3.3.1",
126128
"nodemon": "^3.0.1",
127129
"rimraf": "^5.0.1",
128130
"rollup": "^3.28.1",
129131
"tsup": "^7.2.0",
130132
"typescript": "^5.1.6",
131133
"vite": "^4.4.9",
132134
"vitest": "^0.34.2",
133-
"fast-glob": "^3.3.1",
134135
"webpack": "^5.88.2"
135136
}
136137
}

playground/vite/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "vite-example",
3-
"private": true,
4-
"version": "0.0.0",
53
"type": "module",
4+
"version": "0.0.0",
5+
"private": true,
66
"scripts": {
77
"dev": "vite",
88
"build": "vue-tsc && vite build",

playground/vite/tsconfig.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
22
"compilerOptions": {
33
"target": "ES2020",
4+
"jsx": "preserve",
5+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
46
"useDefineForClassFields": true,
57
"module": "ESNext",
6-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
7-
"skipLibCheck": true,
88

99
/* Bundler mode */
1010
"moduleResolution": "bundler",
11-
"allowImportingTsExtensions": true,
1211
"resolveJsonModule": true,
13-
"isolatedModules": true,
14-
"noEmit": true,
15-
"jsx": "preserve",
12+
"allowImportingTsExtensions": true,
1613

1714
/* Linting */
1815
"strict": true,
16+
"noFallthroughCasesInSwitch": true,
1917
"noUnusedLocals": true,
2018
"noUnusedParameters": true,
21-
"noFallthroughCasesInSwitch": true
19+
"noEmit": true,
20+
"isolatedModules": true,
21+
"skipLibCheck": true
2222
},
23-
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
24-
"references": [{ "path": "./tsconfig.node.json" }]
23+
"references": [{ "path": "./tsconfig.node.json" }],
24+
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
2525
}

playground/vite/tsconfig.node.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"compilerOptions": {
33
"composite": true,
4-
"skipLibCheck": true,
54
"module": "ESNext",
65
"moduleResolution": "bundler",
7-
"allowSyntheticDefaultImports": true
6+
"allowSyntheticDefaultImports": true,
7+
"skipLibCheck": true
88
},
99
"include": ["vite.config.ts"]
1010
}

playground/webpack/babel.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
presets: [
3-
'@vue/cli-plugin-babel/preset'
4-
]
3+
'@vue/cli-plugin-babel/preset',
4+
],
55
}

0 commit comments

Comments
 (0)