chore: 更新 oxlint 配置并添加自动修复命令

扩展 oxlint 配置,添加更多文件类型支持并引入插件
添加 lint:oxlint-fix 命令以支持自动修复
This commit is contained in:
feige996 2025-06-13 17:52:04 +08:00
parent 305ac6dccd
commit fc7d30c510
2 changed files with 21 additions and 7 deletions

View File

@ -1,11 +1,24 @@
{ {
"extends": ["@oxlint/recommended"], "$schema": "./node_modules/oxlint/configuration_schema.json",
"extends": ["config:recommended"],
"plugins": ["import", "typescript", "unicorn"],
"rules": { "rules": {
"no-console": "off", "no-console": "off",
"no-unused-vars": "off" "no-unused-vars": "off"
}, },
"files": ["src/**/*.{js,ts,vue}"], "env": {
"vue": { "es6": true
"enabled": true },
"globals": {
"foo": "readonly"
},
"settings": {},
"overrides": [
{
"files": ["*.test.ts", "*.spec.ts"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
} }
} }
]
}

View File

@ -71,13 +71,14 @@
"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:oxlint": "oxlint src/**/*.{ts,js,vue}" "lint:oxlint": "oxlint src/**/*.{ts,js,vue}",
"lint:oxlint-fix": "oxlint --fix src/**/*.{ts,js,vue}"
}, },
"lint-staged": { "lint-staged": {
"**/*.{html,cjs,json,md,scss,css,txt}": [ "**/*.{html,cjs,json,md,scss,css,txt}": [
"prettier --write --cache" "prettier --write --cache"
], ],
"**/*.{js,ts,vue}": [ "**/*.{js,jsx,ts,tsx,vue,mjs,cjs,mts,cts}": [
"oxlint --fix", "oxlint --fix",
"prettier --write --cache" "prettier --write --cache"
], ],