chore: 将eslint替换为oxlint并更新vscode配置

更新package.json中的lint脚本,从eslint改为oxlint
调整.vscode/settings.json中的格式化配置,启用prettier并优化保存时的自动修复行为
This commit is contained in:
feige996 2025-06-21 17:18:35 +08:00
parent e1654359fd
commit ae515cd85e
2 changed files with 42 additions and 38 deletions

76
.vscode/settings.json vendored
View File

@ -1,14 +1,7 @@
{
// prettier
"editor.defaultFormatter": "esbenp.prettier-vscode",
// //
// "editor.formatOnSave": true,
// //
// "editor.codeActionsOnSave": {
// "source.fixAll": "explicit",
// "source.fixAll.eslint": "explicit",
// "source.fixAll.stylelint": "explicit"
// },
// stylelint
"stylelint.validate": ["css", "scss", "vue", "html"], // package.jsonscripts
"stylelint.enable": true,
@ -62,15 +55,26 @@
"package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,.npmrc,.browserslistrc",
".oxlintrc.json": "tsconfig.json,.commitlintrc.*,.prettier*,.editorconfig,.commitlint.cjs,.eslint*"
},
//
"prettier.enable": true,
"editor.formatOnSave": true,
//
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit"
},
// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,
// "prettier.enable": false,
// "editor.formatOnSave": false,
// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
// "editor.codeActionsOnSave": {
// "source.fixAll.eslint": "explicit",
// "source.organizeImports": "never"
// },
// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
@ -88,27 +92,27 @@
// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"json5",
"jsonc",
"yaml",
"toml",
"xml",
"gql",
"graphql",
"astro",
"svelte",
"css",
"less",
"scss",
"pcss",
"postcss"
// "javascript",
// "javascriptreact",
// "typescript",
// "typescriptreact",
"vue"
// "html",
// "markdown",
// "json",
// "json5",
// "jsonc",
// "yaml",
// "toml",
// "xml",
// "gql",
// "graphql",
// "astro",
// "svelte",
// "css",
// "less",
// "scss",
// "pcss",
// "postcss"
]
}

View File

@ -72,8 +72,8 @@
"type-check": "vue-tsc --noEmit",
"openapi-ts-request": "openapi-ts",
"prepare": "git init && husky",
"lint": "eslint",
"lint:fix": "eslint --fix"
"lint": "oxlint",
"lint:fix": "oxlint --fix"
},
"dependencies": {
"@dcloudio/uni-app": "3.0.0-4060620250520001",