Skip to content

Commit 25d531e

Browse files
committed
Run prettier on pre-commit git hook
1 parent b21bfc1 commit 25d531e

File tree

2 files changed

+304
-7
lines changed

2 files changed

+304
-7
lines changed

package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,21 @@
4545
"eslint": "^9.20.1",
4646
"eslint-plugin-eslint-plugin": "^6.4.0",
4747
"eslint-plugin-n": "^17.17.0",
48+
"lint-staged": "^16.1.0",
4849
"mocha": "11.1.0",
49-
"prettier": "^3.5.3"
50+
"prettier": "^3.5.3",
51+
"simple-git-hooks": "^2.13.0"
5052
},
5153
"peerDependencies": {
5254
"eslint": ">=7.0.0"
5355
},
54-
"packageManager": "yarn@4.6.0"
56+
"packageManager": "yarn@4.6.0",
57+
"simple-git-hooks": {
58+
"pre-commit": "yarn lint-staged"
59+
},
60+
"lint-staged": {
61+
"*.js": [
62+
"prettier --write"
63+
]
64+
}
5565
}

0 commit comments

Comments
 (0)