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
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
yarn lint
|
||||
yarn format:check
|
||||
set -e
|
||||
yarn lint-staged
|
||||
|
||||
@@ -17,6 +17,13 @@
|
||||
"format:check": "prettier --check .",
|
||||
"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": {
|
||||
"antd": "^6.3.5",
|
||||
"react": "^19.2.4",
|
||||
|
||||
Reference in New Issue
Block a user