Linting

Linting is the automated process of analyzing code for potential errors, style inconsistencies, and problematic patterns. A linter scans your code and flags issues — unused variables, inconsistent formatting, potential bugs — before they cause problems. For vibe coders, linters catch mistakes in AI-generated code automatically.

Example

AI generates a component with an unused import, inconsistent indentation, and a variable declared but never used. Your linter (Biome, ESLint) highlights all three issues instantly, before you even run the code.

Linters are your code's spell checker. They catch small mistakes that would otherwise accumulate into confusing, hard-to-maintain codebases.

What Linters Catch

CategoryExamples
ErrorsUnused variables, unreachable code
StyleInconsistent quotes, missing semicolons
Best practicesConsole.log left in code, any type usage
Potential bugsEquality with == instead of ===
LinterSpeedNotes
BiomeFastestLinter + formatter in one tool
ESLintStandardMost plugins and configurations
PrettierFastFormatter only (pairs with ESLint)

Linting and AI-Generated Code

AI code usually follows best practices, but linters still catch:

  • Unused imports — AI includes libraries it doesn't end up using
  • Inconsistent style — Different AI sessions may use different conventions
  • Missing error handling — AI sometimes skips edge cases
  • Debug code — console.log statements left in production code

Setting Up Linting

  1. Install a linternpm install --save-dev @biomejs/biome
  2. Configure rules — Define what matters for your project
  3. Editor integration — See issues as you type
  4. CI integration — Block deploys with lint errors

The Fix-on-Save Workflow

Configure your editor to auto-fix lint issues on save. This means:

  • You write (or AI generates) code
  • You save the file
  • Formatting and fixable issues are corrected automatically
  • You only deal with issues that need human judgment
Ad
Favicon