Skip to content

Commit a2e069f

Browse files
josephperrottAndrewKushnir
authored andcommitted
build: run formatting automatically on pre-commit hook (angular#38402)
Runs the `ng-dev format changed` command whenever the `git commit` command is run. As all changes which are checked by CI will require this check passing, this change can prevent needless roundtrips to correct lint/formatting errors. This automatic formatting can be bypassed with the `--no-verify` flag on the `git commit` command. PR Close angular#38402
1 parent 28534d8 commit a2e069f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@
209209
"cldr-data-coverage": "full",
210210
"husky": {
211211
"hooks": {
212+
"pre-commit": "yarn -s ng-dev format staged",
212213
"commit-msg": "yarn -s ng-dev commit-message pre-commit-validate --file-env-variable HUSKY_GIT_PARAMS"
213214
}
214215
}

0 commit comments

Comments
 (0)