Two distinct jobs
- A linter finds likely bugs and bad patterns such as unused variables or missing dependency arrays.
- A formatter rewrites whitespace, quotes, and line breaks to one consistent style.
They overlap but solve different problems. Let the formatter own style and the linter own correctness.
Why automate
- Removes bikeshedding about style in code review.
- Catches whole classes of bugs before they reach runtime.
- Keeps a large codebase consistent across many contributors.
Run it in the right places
- Editor instant feedback while typing.
- Pre commit auto fix and block obvious problems locally.
- CI the final gate so nothing unformatted or failing lint merges.
Configure the formatter and linter to not fight each other so saving a file is conflict free.
Key idea
Let a formatter own style and a linter own correctness, then enforce both from editor to CI.