chore: 将eslint替换为oxlint并更新vscode配置
更新package.json中的lint脚本,从eslint改为oxlint 调整.vscode/settings.json中的格式化配置,启用prettier并优化保存时的自动修复行为
This commit is contained in:
parent
e1654359fd
commit
ae515cd85e
76
.vscode/settings.json
vendored
76
.vscode/settings.json
vendored
@ -1,14 +1,7 @@
|
|||||||
{
|
{
|
||||||
// 默认格式化工具选择prettier
|
// 默认格式化工具选择prettier
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
// // 保存的时候自动格式化
|
|
||||||
// "editor.formatOnSave": true,
|
|
||||||
// //开启自动修复
|
|
||||||
// "editor.codeActionsOnSave": {
|
|
||||||
// "source.fixAll": "explicit",
|
|
||||||
// "source.fixAll.eslint": "explicit",
|
|
||||||
// "source.fixAll.stylelint": "explicit"
|
|
||||||
// },
|
|
||||||
// 配置stylelint检查的文件类型范围
|
// 配置stylelint检查的文件类型范围
|
||||||
"stylelint.validate": ["css", "scss", "vue", "html"], // 与package.json的scripts对应
|
"stylelint.validate": ["css", "scss", "vue", "html"], // 与package.json的scripts对应
|
||||||
"stylelint.enable": true,
|
"stylelint.enable": true,
|
||||||
@ -62,15 +55,26 @@
|
|||||||
"package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,.npmrc,.browserslistrc",
|
"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*"
|
".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
|
// Disable the default formatter, use eslint instead
|
||||||
"prettier.enable": false,
|
// "prettier.enable": false,
|
||||||
"editor.formatOnSave": false,
|
// "editor.formatOnSave": false,
|
||||||
|
|
||||||
// Auto fix
|
// Auto fix
|
||||||
"editor.codeActionsOnSave": {
|
// "editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": "explicit",
|
// "source.fixAll.eslint": "explicit",
|
||||||
"source.organizeImports": "never"
|
// "source.organizeImports": "never"
|
||||||
},
|
// },
|
||||||
|
|
||||||
// Silent the stylistic rules in you IDE, but still auto fix them
|
// Silent the stylistic rules in you IDE, but still auto fix them
|
||||||
"eslint.rules.customizations": [
|
"eslint.rules.customizations": [
|
||||||
@ -88,27 +92,27 @@
|
|||||||
|
|
||||||
// Enable eslint for all supported languages
|
// Enable eslint for all supported languages
|
||||||
"eslint.validate": [
|
"eslint.validate": [
|
||||||
"javascript",
|
// "javascript",
|
||||||
"javascriptreact",
|
// "javascriptreact",
|
||||||
"typescript",
|
// "typescript",
|
||||||
"typescriptreact",
|
// "typescriptreact",
|
||||||
"vue",
|
"vue"
|
||||||
"html",
|
// "html",
|
||||||
"markdown",
|
// "markdown",
|
||||||
"json",
|
// "json",
|
||||||
"json5",
|
// "json5",
|
||||||
"jsonc",
|
// "jsonc",
|
||||||
"yaml",
|
// "yaml",
|
||||||
"toml",
|
// "toml",
|
||||||
"xml",
|
// "xml",
|
||||||
"gql",
|
// "gql",
|
||||||
"graphql",
|
// "graphql",
|
||||||
"astro",
|
// "astro",
|
||||||
"svelte",
|
// "svelte",
|
||||||
"css",
|
// "css",
|
||||||
"less",
|
// "less",
|
||||||
"scss",
|
// "scss",
|
||||||
"pcss",
|
// "pcss",
|
||||||
"postcss"
|
// "postcss"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -72,8 +72,8 @@
|
|||||||
"type-check": "vue-tsc --noEmit",
|
"type-check": "vue-tsc --noEmit",
|
||||||
"openapi-ts-request": "openapi-ts",
|
"openapi-ts-request": "openapi-ts",
|
||||||
"prepare": "git init && husky",
|
"prepare": "git init && husky",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"lint:fix": "eslint --fix"
|
"lint:fix": "oxlint --fix"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dcloudio/uni-app": "3.0.0-4060620250520001",
|
"@dcloudio/uni-app": "3.0.0-4060620250520001",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user