# Linter

> A tool that reads your code and points out likely bugs and messy style before it runs.

- Level: Intermediate
- Topics: Software
- URL: https://tidbit.legios.com.ar/linter/
- In Spanish: [Linter](https://tidbit.legios.com.ar/es/linter/)

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.

## An analogy

A spell checker for code. It will not tell you whether your essay is good, but it underlines the typos and odd sentences before your teacher sees them.

## 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.

## Go deeper

- [Lint (software) on Wikipedia](https://en.wikipedia.org/wiki/Lint_(software))
- [ESLint core concepts (official docs)](https://eslint.org/docs/latest/use/core-concepts/)
- [The Ruff linter (official docs)](https://docs.astral.sh/ruff/linter/)

## Related terms

- [Source code](https://tidbit.legios.com.ar/source-code/): The human-readable text that programmers write and that a program is built from.
- [JavaScript](https://tidbit.legios.com.ar/javascript/): The programming language that runs inside web pages and makes them interactive.
- [TypeScript](https://tidbit.legios.com.ar/typescript/): JavaScript with types added, so many mistakes are caught before the code runs.
- [Python](https://tidbit.legios.com.ar/python/): A popular programming language known for being easy to read and quick to write.
- [Ruby](https://tidbit.legios.com.ar/ruby/): A programming language designed to make programmers happy, famous for Ruby on Rails.
- [IDE](https://tidbit.legios.com.ar/ide/): The app where programmers write, run and fix code, with all the tools in one window.
- [CI/CD](https://tidbit.legios.com.ar/ci-cd/): Automation that builds, tests and ships every code change, so releases become routine.
- [Code review](https://tidbit.legios.com.ar/code-review/): Having another person read a code change before it becomes part of the product.
