Commit 526e9056 by Jaxon

style: monorepo仓库使用lintstage来校验.该插件会仅对git提交的文件进行校验.适合老项目

1 parent 0b9f2f16
export default { export default {
"*.{js,ts,tsx,jsx,vue}": [ "prettier --write", "eslint --fix" ], "*.{js,jsx,ts,tsx,vue,md}": "pnpm eslint --cache --fix",
"*.{md,json,css,less,scss}": [ "prettier --write" ], "package.json": "pnpm eslint --cache --fix",
"{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": "pnpm eslint --cache --fix",
"*.{scss,less,styl,html,vue,css,wxss}":"pnpm stylelint --fix --allow-empty-input",
}; };
...@@ -252,9 +252,7 @@ ...@@ -252,9 +252,7 @@
"oxc.enable": false, "oxc.enable": false,
"cSpell.words": ["archiver", "axios", "dotenv", "isequal", "jspm", "napi", "nolebase", "rollup", "vitest"], "cSpell.words": ["archiver", "axios", "dotenv", "isequal", "jspm", "napi", "nolebase", "rollup", "vitest"],
// 语言特定配置 - LESS 注释 "[yaml]": {
"[less]": { "editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.comments.lineComment": "//",
"editor.comments.blockComment": ["/*", "*/"]
} }
} }
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
"axios-adapter-uniapp": "^0.1.4", "axios-adapter-uniapp": "^0.1.4",
"axios-miniprogram-adapter": "^0.3.5", "axios-miniprogram-adapter": "^0.3.5",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"lib": "file:../lib",
"pinyin-pro": "^3.27.0", "pinyin-pro": "^3.27.0",
"uview-plus": "^3.6.4", "uview-plus": "^3.6.4",
"vue": "3.4.21", "vue": "3.4.21",
......
...@@ -46,24 +46,8 @@ pre-commit: ...@@ -46,24 +46,8 @@ pre-commit:
commands: commands:
code-workspace: code-workspace:
run: pnpm vsh code-workspace --auto-commit run: pnpm vsh code-workspace --auto-commit
lint-md: lint-staged:
run: pnpm eslint --cache --fix {staged_files} run: pnpm lint-staged
glob: "*.md"
lint-vue:
glob: "*.vue"
run: pnpm eslint --cache --fix {staged_files}
lint-js:
run: pnpm eslint --cache --fix {staged_files}
glob: "*.{js,jsx,ts,tsx}"
lint-style:
run: pnpm stylelint --fix --allow-empty-input {staged_files}
glob: "*.{scss,less,styl,html,vue,css,wxss}"
lint-package:
run: pnpm eslint --cache --fix {staged_files}
glob: "package.json"
lint-json:
run: pnpm eslint --cache --fix {staged_files}
glob: "{!(package)*.json,*.code-snippets,.!(browserslist)*rc}"
post-merge: post-merge:
commands: commands:
......
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
"happy-dom": "catalog:", "happy-dom": "catalog:",
"husky": "^9.1.7", "husky": "^9.1.7",
"lefthook": "catalog:", "lefthook": "catalog:",
"lint-staged": "^16.2.7",
"playwright": "catalog:", "playwright": "catalog:",
"rimraf": "catalog:", "rimraf": "catalog:",
"rollup": "catalog:", "rollup": "catalog:",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!