From f68a1d3708ca33d692ff917233db3a85c7d3006d Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Tue, 11 Aug 2020 16:09:00 -0700 Subject: [PATCH] build: run formatting automatically on pre-commit hook (#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 #38402 --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 7b8247a1a5..d38b0d1eee 100644 --- a/package.json +++ b/package.json @@ -207,6 +207,7 @@ "cldr-data-coverage": "full", "husky": { "hooks": { + "pre-commit": "yarn -s ng-dev format staged", "commit-msg": "yarn -s ng-dev commit-message pre-commit-validate --file-env-variable HUSKY_GIT_PARAMS" } }