So a linter is about enforcing a code style in a team/company, correct?
Where do code formatters fit with this in your opinion? Does it overlap with a linter?
Then their build will fail and they will have to manually do the changes. (Or like npm run lint). However, this wasn't an issue before, everyone just uses a formatter.
So you define the essence of something by its fuel? 😄
My take is the following: A linter is a tool that creates guarantees by enforcing constraints on how the code is written through the reporting of blocking errors.
Haha, fair point! I was joking earlier. A linter is definitely about enforcing constraints to improve code quality. But often trends sneak in, like whether we define functions with “function” or lambda, or use “let” everywhere instead of “const” and "let"
You get the guarantees and constraints that the enabled rules add. If you enforce let vs const, then you get that guarantee, at the cost of the constraint. Here, maybe it's consistent style, to avoid styling arguments.
Is the guarantee worth the constraint? That's up to the team to decide.
Comments
Where do code formatters fit with this in your opinion? Does it overlap with a linter?
Formatter lives in your ide (like format on save)
Linter runs in CI and if it fails, the build fails.
Since using a formatter, have you disabled (redundant) styling rules from your linter?
My take is the following: A linter is a tool that creates guarantees by enforcing constraints on how the code is written through the reporting of blocking errors.
Is the guarantee worth the constraint? That's up to the team to decide.