From a2e069fdda3bd1c54783d8868ce86e10ae12eea1 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 350be9de2d..ee23d0a23c 100644 --- a/package.json +++ b/package.json @@ -209,6 +209,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" } }