Skip to content

Commit df76f4f

Browse files
committed
Merge branch 'add-husky-to-fix-formatting-on-commits' into merge-social-icon-refactoring
* add-husky-to-fix-formatting-on-commits: Use husky to ensure eslint & prettier rules on git commits
2 parents 6400e9a + afd5e91 commit df76f4f

File tree

2 files changed

+368
-21
lines changed

2 files changed

+368
-21
lines changed

package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
"analyze:browser": "cross-env BUNDLE_ANALYZE=browser next build",
2828
"test": "run-p test:*",
2929
"test:lint": "eslint .",
30-
"test:prettier": "prettier '**/*.{js,jsx,ts,tsx}' --check"
30+
"test:prettier": "prettier '**/*.{js,jsx,ts,tsx}' --check",
31+
"prepare": "husky install",
32+
"pre-commit": "lint-staged"
3133
},
3234
"dependencies": {
3335
"@fisch0920/use-dark-mode": "^2.4.0",
@@ -66,7 +68,15 @@
6668
"eslint": "^8.57.1",
6769
"npm-run-all2": "^7.0.1",
6870
"prettier": "^3.3.3",
69-
"typescript": "^5.6.3"
71+
"typescript": "^5.6.3",
72+
"husky": "^8.0.1",
73+
"lint-staged": "^12.3.6"
74+
},
75+
"lint-staged": {
76+
"*.{ts,tsx}": [
77+
"prettier --write",
78+
"eslint --fix"
79+
]
7080
},
7181
"overrides": {
7282
"cacheable-request": {

0 commit comments

Comments
 (0)