Linter
A tool that reads your code and points out likely bugs and messy style before it runs.
A linter is a program that reads source code without running it and flags things that look wrong or sloppy: a variable you declared but never used, a comparison that is always true, a function called with the wrong number of arguments, a line that breaks the team's style rules. The name comes from lint, a tool written at Bell Labs in the late 1970s to check C programs, named after the bits of fluff a dryer's lint trap catches.
Every popular language has its linters: ESLint for JavaScript and TypeScript, Pylint and Ruff for Python, RuboCop for Ruby. They run inside the code editor, underlining problems as you type, and again in the CI pipeline, where a failed lint check can block a change from being merged until it is fixed.
A linter is different from a formatter, which only rewrites spacing and line breaks so all the code looks the same, and from tests, which actually run the code. Teams use all three. The linter's job is to catch the cheap mistakes automatically, so that code review can focus on whether the change makes sense rather than on missing semicolons.
Keep in mind
- Analyzes code without running it and flags likely bugs and style problems.
- Named after
lint, a 1970s Bell Labs tool for C. - Examples: ESLint (JavaScript), Ruff and Pylint (Python), RuboCop (Ruby).
- Usually runs in the editor and again in CI before merging.