Skip to content

Commit ec817a2

Browse files
committed
chore: format code before submitting it
1 parent ffa9354 commit ec817a2

File tree

4 files changed

+59
-194
lines changed

4 files changed

+59
-194
lines changed

.vscode/settings.json

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,46 @@
33
"Astro",
44
"bumpp",
55
"coderwyd",
6-
"taze"
6+
"taze",
7+
"tsup"
78
],
9+
// Enable the ESlint flat config support
10+
"eslint.experimental.useFlatConfig": true,
11+
12+
// Disable the default formatter, use eslint instead
813
"prettier.enable": false,
914
"editor.formatOnSave": false,
15+
16+
// Auto fix
1017
"editor.codeActionsOnSave": {
1118
"source.fixAll.eslint": true,
1219
"source.organizeImports": false
1320
},
14-
"eslint.experimental.useFlatConfig": true,
15-
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "html", "markdown", "json", "jsonc", "yaml"]
21+
22+
// Silent the stylistic rules in you IDE, but still auto fix them
23+
"eslint.rules.customizations": [
24+
{ "rule": "style/*", "severity": "off" },
25+
{ "rule": "*-indent", "severity": "off" },
26+
{ "rule": "*-spacing", "severity": "off" },
27+
{ "rule": "*-spaces", "severity": "off" },
28+
{ "rule": "*-order", "severity": "off" },
29+
{ "rule": "*-dangle", "severity": "off" },
30+
{ "rule": "*-newline", "severity": "off" },
31+
{ "rule": "*quotes", "severity": "off" },
32+
{ "rule": "*semi", "severity": "off" }
33+
],
34+
35+
// Enable eslint for all supported languages
36+
"eslint.validate": [
37+
"javascript",
38+
"javascriptreact",
39+
"typescript",
40+
"typescriptreact",
41+
"vue",
42+
"html",
43+
"markdown",
44+
"json",
45+
"jsonc",
46+
"yaml"
47+
]
1648
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,15 @@
6868
"vue-eslint-parser": "^9.3.1",
6969
"yaml-eslint-parser": "^1.2.2"
7070
},
71+
"nano-staged": {
72+
"*": "eslint --fix"
73+
},
7174
"devDependencies": {
7275
"@types/node": "^20.6.3",
7376
"@types/react": "^18.2.22",
7477
"bumpp": "^9.2.0",
7578
"eslint": "^8.49.0",
76-
"eslint-plugin-sort-keys": "^2.3.5",
77-
"lint-staged": "^14.0.1",
79+
"nano-staged": "^0.8.0",
7880
"react": "^18.2.0",
7981
"simple-git-hooks": "^2.9.0",
8082
"sucrase": "^3.34.0",

0 commit comments

Comments
 (0)