# Linter

> A tool that reads code without running it. It points out likely slips.

**Field:** Software Development  
**Category:** Editors & Tools  
**Also known as:** Lint, Static Checker

## Think of it like

Think of it like a spell check for code. It marks what looks wrong before you send it.

## Definition

A linter reads your code without running it and points out likely mistakes. It catches things like a variable you never use, a name that is spelled two ways or a risky pattern. It can also check that the code follows the team's style rules. ESLint for JavaScript and Ruff for Python are common ones. Most run inside the editor and mark problems as you type.

## Example

Ruff warns Jack that he set total but never used it. The real bug was that he returned price instead of total.

## Example code

```console
$ ruff check pay.py
pay.py:1:8: F401 [*] `os` imported but unused
pay.py:4:5: F841 Local variable `total` is assigned to but never used
Found 2 errors.
```

Two warnings with a file, a line and a short reason for each.

## Why it matters

A linter catches small slips in seconds, before a test or a teammate has to. It keeps a shared codebase tidy.

## Common mistake

Turning the warnings off because there are too many. Fix them a few at a time instead; each one is a real hint.

## Three principles

- **No running needed.** It only reads the code.
- **Finds likely bugs.** Unused names and risky patterns stand out.
- **Checks style too.** One team, one way of writing.

## Related terms

- [Code Formatter](https://learn.benibix.com/term/development/formatter)
- [Debugger](https://learn.benibix.com/term/development/debugger)
- [Bug](https://learn.benibix.com/term/development/bug)
- [Code Editor](https://learn.benibix.com/term/development/code-editor)
- [ESLint](https://learn.benibix.com/term/development/eslint)

## Told apart from

- [Linter vs Formatter](https://learn.benibix.com/compare/linter-vs-formatter): A linter reads code and warns about likely bugs. A formatter only fixes spaces and line breaks, and never what code does.

## Taught in

- [Linters and Formatters](https://learn.benibix.com/learn/development-tools/linters-and-formatters): Coding Tools, 4/13

---

Source: https://learn.benibix.com/term/development/linter
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
