Skip to content

Commit e20416f

Browse files
committedNov 13, 2023
chore: update new Eslint config
Eslint Deprecate formatting rules [#17522](eslint/eslint#17522). Move to [ESLint Stylistic](https://eslint.style/) link [@antfu/eslint-config](https://github.com/antfu/eslint-config)
1 parent d2b32de commit e20416f

File tree

4 files changed

+791
-610
lines changed

4 files changed

+791
-610
lines changed
 

‎.vscode/settings.json

+42-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,51 @@
11
{
2-
"cSpell.words": ["Vitesse"],
3-
"prettier.enable": false,
4-
"editor.codeActionsOnSave": {
5-
"source.fixAll.eslint": true
6-
},
72
"files.associations": {
83
"*.css": "postcss"
94
},
5+
6+
// Enable the ESlint flat config support
7+
"eslint.experimental.useFlatConfig": true,
8+
9+
// Disable the default formatter
10+
"prettier.enable": false,
1011
"editor.formatOnSave": false,
1112

13+
// Auto fix
14+
"editor.codeActionsOnSave": {
15+
"source.fixAll.eslint": "explicit",
16+
"source.organizeImports": "never"
17+
},
18+
19+
// Silent the stylistic rules in you IDE, but still auto fix them
20+
"eslint.rules.customizations": [
21+
{ "rule": "style/*", "severity": "off" },
22+
{ "rule": "*-indent", "severity": "off" },
23+
{ "rule": "*-spacing", "severity": "off" },
24+
{ "rule": "*-spaces", "severity": "off" },
25+
{ "rule": "*-order", "severity": "off" },
26+
{ "rule": "*-dangle", "severity": "off" },
27+
{ "rule": "*-newline", "severity": "off" },
28+
{ "rule": "*quotes", "severity": "off" },
29+
{ "rule": "*semi", "severity": "off" }
30+
],
31+
32+
// The following is optional.
33+
// It's better to put under project setting `.vscode/settings.json`
34+
// to avoid conflicts with working with different eslint configs
35+
// that does not support all formats.
36+
"eslint.validate": [
37+
"javascript",
38+
"javascriptreact",
39+
"typescript",
40+
"typescriptreact",
41+
"vue",
42+
"html",
43+
"markdown",
44+
"json",
45+
"jsonc",
46+
"yaml"
47+
],
48+
1249
/**
1350
* 解决 unocss @apply 警告问题
1451
* @see https://github.com/tailwindlabs/tailwindcss/discussions/5258#discussioncomment-1979394

‎eslint.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const uni = require('@uni-helper/eslint-config')
2+
const unocss = require('@unocss/eslint-plugin')
3+
4+
module.exports = uni(
5+
{},
6+
unocss.configs.flat,
7+
)

‎package.json

+2-8
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,21 @@
6262
"vue-i18n": "^9.5.0"
6363
},
6464
"devDependencies": {
65-
"@antfu/eslint-config": "^0.43.1",
6665
"@dcloudio/types": "^3.4.1",
6766
"@dcloudio/uni-automator": "3.0.0-3081220230817001",
6867
"@dcloudio/uni-cli-shared": "3.0.0-3081220230817001",
6968
"@dcloudio/uni-stacktracey": "3.0.0-3081220230817001",
7069
"@dcloudio/vite-plugin-uni": "3.0.0-3081220230817001",
7170
"@iconify-json/carbon": "^1.1.21",
71+
"@uni-helper/eslint-config": "^0.0.4",
7272
"@uni-helper/uni-app-types": "^0.5.12",
7373
"@uni-helper/unocss-preset-uni": "^0.2.4",
7474
"@uni-helper/vite-plugin-uni-layouts": "^0.1.6",
7575
"@uni-helper/vite-plugin-uni-pages": "^0.2.12",
7676
"@unocss/eslint-config": "^0.57.1",
7777
"@vue-macros/reactivity-transform": "^0.3.23",
7878
"@vue/test-utils": "^2.4.1",
79-
"eslint": "^8.52.0",
79+
"eslint": "^8.53.0",
8080
"lint-staged": "^15.0.2",
8181
"pnpm": "^8.9.2",
8282
"sass": "^1.69.4",
@@ -95,11 +95,5 @@
9595
},
9696
"lint-staged": {
9797
"*": "eslint --fix"
98-
},
99-
"eslintConfig": {
100-
"extends": [
101-
"@antfu",
102-
"@unocss"
103-
]
10498
}
10599
}

‎pnpm-lock.yaml

+740-597
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.