DEV Community

Discussion on: React best practices and patterns to reduce code - Part 3

Collapse
 
pikekwc profile image
pike-kwc

Thanks for the tips.

I have a love/hate relationship with the pre-commit hook. It can be useful, but almost every time I've joined a code base that uses it, it has been VERY strict and heavy handed, but your example runs the lint/prettier instead of running a checker which is much nicer.

Your note to actually put it in the CI/CD is great, I wish more people would do that, rather than making me run "npx stylelint src/*.scss" because background is before display or some other nonsense that makes my commit fail.

I was working on someone elses code base, and they basically told me to just run --no-verify because the pre-commit was so strict.

Collapse
 
devsmitra profile image
Rahul Sharma • Edited

That's true, Most of the time people comment eslint rule or disable for file, CI/CD is best option.