Skip to content

Commit 7412351

Browse files
committed
Add lint-staged
1 parent 1c31df6 commit 7412351

File tree

3 files changed

+276
-11
lines changed

3 files changed

+276
-11
lines changed

.husky/pre-commit

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
yarn run format
5-
yarn run lint
4+
yarn run lint-staged

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"html-webpack-plugin": "^5.5.0",
4141
"husky": "^8.0.3",
4242
"jest": "^29.4.3",
43+
"lint-staged": "^13.2.3",
4344
"npm-run-all": "^4.1.5",
4445
"prettier": "^2.8.4",
4546
"react": "^18.2.0",
@@ -59,9 +60,11 @@
5960
"dev:client": "webpack --watch",
6061
"dev:server": "tsc --build --watch",
6162
"dev": "run-p dev:*",
62-
"format": "eslint --fix . && prettier --write .",
63+
"format": "eslint --fix . && prettier --list-different --write .",
6364
"lint": "run-p lint:*",
65+
"lint:prettier:fix": "prettier --list-different --ignore-unknown --write",
6466
"lint:prettier": "prettier --check .",
67+
"lint:eslint:fix": "eslint --fix",
6568
"lint:eslint": "eslint .",
6669
"lint:typecheck": "tsc --noEmit",
6770
"prepare": "husky install",
@@ -82,5 +85,13 @@
8285
"packageManager": "yarn@1.22.19",
8386
"engines": {
8487
"node": ">=18.0.0"
88+
},
89+
"lint-staged": {
90+
"*.{js,ts,tsx}": [
91+
"yarn run lint:eslint:fix"
92+
],
93+
"*": [
94+
"yarn run lint:prettier:fix"
95+
]
8596
}
8697
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy