The why and how I choose to use this tools in my development workflow.
Most of them don't significantly change the code and could be easily removed or modified if needed.
Their focus is to automate tasks that although important are tedious and repetitive to do.
A super side bonus is ensuring a code style inside your repository, therefore leading to more productive PRs.
Husky helps us work with git hooks in a more simple fashion.
Hooks can run tasks in between our normal git workflow (similar to pre and post npm scripts).
There are 3 hooks defined in husky.config.js
Runs lint-staged on any file a developer tries to commit.
At the moment whenever a .js file is to be committed that file is formatted and linted.
If any tool in the pipeline throws an error the whole commit is denied and a message is shown.
This is to prevent "bad" code from entering the repository and to favor smaller, more focused commits.
Continuing with the theme of small meaningful commits we now go to the actual message written.
Commit messages matter but developers tend to either don't care or follow a personal style that is different from the rest.
To make following a standard painless we use Commitizen (with the conventional-changelog flavor).
Whenever git commit is called a form will appear on the command line to help you write the commit message.
Since developers can still use some other method besides git commit how can we ensure that the standards are followed ?
Simple... We lint the messages with commitlint to match with the standards you chose to follow.
Tabs or spaces, semicolons or no semicolons, single or double quotes, and a million other vain issues to discuss.
Everyone has had that one meeting called only to argue about this things... please don't.
Just change Prettier and let's move on with our lives.
PS: I'm using EditorConfig as a fallback here... just in case.
Some things aren't so black and white when it comes to code quality and witting style.
Javascript is a pretty awesome language in my opinion, but it does have some quirks that can trip newcomers.
To help with those cases and to aid with the code style we are using ESLint with Javascript Standard Style.