only format staged files on pre-commit and lint & type-check on push

This commit is contained in:
Maximilian Schneider 2021-04-27 12:32:00 +03:00
parent 5eff6011d8
commit 057798b2a1
2 changed files with 3 additions and 4 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
. "$(dirname "$0")/_/husky.sh" . "$(dirname "$0")/_/husky.sh"
yarn type-check yarn type-check && yarn lint

View File

@ -11,13 +11,12 @@
"tc": "yarn type-check --watch", "tc": "yarn type-check --watch",
"type-check": "tsc --pretty --noEmit", "type-check": "tsc --pretty --noEmit",
"format": "prettier --write .", "format": "prettier --write .",
"lint": "eslint . --ext ts --ext tsx --ext js", "lint": "eslint . --ext ts --ext tsx --ext js --ext jsx",
"test": "jest", "test": "jest",
"test-all": "yarn lint && yarn type-check && yarn test" "test-all": "yarn lint && yarn type-check && yarn test"
}, },
"lint-staged": { "lint-staged": {
"*.@(ts|tsx)": [ "*.@(ts|tsx|js|jsx)": [
"yarn lint",
"yarn format" "yarn format"
] ]
}, },