prettier-schematic icon indicating copy to clipboard operation
prettier-schematic copied to clipboard

Broken by husky v5/6

Open inorganik opened this issue 4 years ago • 1 comments

Describe the bug

In the current configuration, the pre-commit hook doesn't work if version 5 or above of husky is installed

To Reproduce Steps to reproduce the behavior:

  1. ng new an app
  2. run the schematic
  3. create a scss file that has text on the last line
  4. commit

Expected behavior Prettier should add an empty line to the end of the scss file

Actual Prettier does not run.

Screenshots If applicable, add screenshots to help explain your problem.

Was able to fix by installing husky@4 (installed v4.3.8)

inorganik avatar May 20 '21 21:05 inorganik

I noticed that the schematic now installs v4.3.8 of husky but changes package.json to have "latest" as the version for all the packages this schematic installs.

So if developer A runs the schematic and pushes their changes, then developer B pulls the latest, and runs npm install, they will get the incorrect version of husky and the problem will persist.

inorganik avatar Nov 17 '21 16:11 inorganik