chore: 使用 lint-staged 配置提交前校验
Made-with: Cursor
This commit is contained in:
6
.husky/pre-commit
Normal file → Executable file
6
.husky/pre-commit
Normal file → Executable file
@@ -1,5 +1,3 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
set -e
|
||||||
|
yarn lint-staged
|
||||||
yarn lint
|
|
||||||
yarn format:check
|
|
||||||
|
|||||||
@@ -17,6 +17,13 @@
|
|||||||
"format:check": "prettier --check .",
|
"format:check": "prettier --check .",
|
||||||
"prepare": "husky"
|
"prepare": "husky"
|
||||||
},
|
},
|
||||||
|
"lint-staged": {
|
||||||
|
"*.{ts,tsx}": [
|
||||||
|
"eslint --fix --max-warnings=0",
|
||||||
|
"prettier --write"
|
||||||
|
],
|
||||||
|
"*.{css,json,md,html,yml,yaml,js,mjs,cjs}": "prettier --write"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"antd": "^6.3.5",
|
"antd": "^6.3.5",
|
||||||
"react": "^19.2.4",
|
"react": "^19.2.4",
|
||||||
|
|||||||
Reference in New Issue
Block a user