What it checks
- Syntax errors and dangerous code
- Unused variables and unreachable code
- Style violations: indentation, quotes, semicolons
- Dangerous patterns (e.g.
== instead of === in JS)
Popular linters
- PHP: PHP_CodeSniffer, PHPStan, Psalm — static analysis with type checking
- JavaScript: ESLint — most flexible, with thousands of plugins
- Python: Ruff, Flake8, Pylint
- CSS: Stylelint
Linter vs Formatter
A linter finds problems; a formatter fixes formatting automatically (Prettier, php-cs-fixer). They are often run together in pre-commit hooks.