style: lint code

This commit is contained in:
Sun-ZhenXing
2026-02-23 17:41:05 +08:00
parent ced072de66
commit 7e14b01b78
240 changed files with 4301 additions and 1539 deletions

View File

@@ -1,7 +1,7 @@
{
"recommendations": [
"yzhang.markdown-all-in-one",
"DavidAnson.vscode-markdownlint",
"redhat.vscode-yaml"
"dbaeumer.vscode-eslint",
"ms-azuretools.vscode-containers"
]
}

91
.vscode/settings.json vendored
View File

@@ -1,6 +1,9 @@
{
// Disable Prettier, use ESLint for formatting instead
"prettier.enable": false,
// Disable default formatOnSave, use ESLint fixOnSave
"editor.formatOnSave": false,
// Markdown settings
"[markdown]": {
"editor.wordWrap": "on",
"editor.formatOnSave": true,
@@ -13,15 +16,97 @@
"strings": "off"
}
},
// YAML settings: auto-fix ESLint issues on save
"[yaml]": {
"editor.formatOnSave": true
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"[dockerfile]": {
"editor.formatOnSave": true
},
// Docker Compose settings
"[dockercompose]": {
"editor.formatOnSave": true
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
// File EOL configuration
"files.eol": "\n",
"cSpell.enabled": false
// Disable spell checking
"cSpell.enabled": false,
// ESLint settings: auto-fix on save
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
// Silent stylistic rules in IDE but still auto-fix them
"eslint.rules.customizations": [
{
"rule": "style/*",
"severity": "off",
"fixable": true
},
{
"rule": "format/*",
"severity": "off",
"fixable": true
},
{
"rule": "*-indent",
"severity": "off",
"fixable": true
},
{
"rule": "*-spacing",
"severity": "off",
"fixable": true
},
{
"rule": "*-spaces",
"severity": "off",
"fixable": true
},
{
"rule": "*-order",
"severity": "off",
"fixable": true
},
{
"rule": "*-dangle",
"severity": "off",
"fixable": true
},
{
"rule": "*-newline",
"severity": "off",
"fixable": true
},
{
"rule": "*quotes",
"severity": "off",
"fixable": true
},
{
"rule": "*semi",
"severity": "off",
"fixable": true
}
],
// Enable ESLint for supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"dockercompose"
]
}