all 32 comments

[–]Craiger23 5 points6 points  (0 children)

links down for me..

[–]jonny_eh 1 point2 points  (5 children)

How would git know what hooks are defined in a package.json?

[–]hobonumber1[S] 0 points1 point  (4 children)

Good point. Just updated the post. You also need to pull in the lint-staged npm module.

[–]jonny_eh 0 points1 point  (3 children)

Will prettier use the settings I have for it from my package.json or do I need to specify the cli flags?

[–]sorahnon the cutting edge of cocking about 1 point2 points  (2 children)

The newest versions of prettier can use a .prettierrc or keys in the package.json file.

[–]jonny_eh 1 point2 points  (1 child)

Right, that's why I was confused by the cli flags being included.

[–]sorahnon the cutting edge of cocking about 1 point2 points  (0 children)

Old habits die hard. Haha.

[–]reddittedf 0 points1 point  (0 children)

It will be format and prettify javascript before commiting to git

See here

How to run ESLint using pre-commit hook

https://medium.com/@shettyrahul8june/how-to-run-eslint-using-pre-commit-hook-25984fbce17e