Open this lesson in your favourite AI. It'll walk you through the why, explain the demo, and quiz you on the try-it list.
JavaScript/TypeScript linting still has more debate than Go or Rust, but the 2026 baseline is clear: ESLint (with typescript-eslint for TS) for catching bugs and style consistency, Prettier for formatting. Pair them with a pre-commit hook (lint-staged + husky, or simple shell script) and CI gating. Don't fight Prettier; it has fewer config options on purpose. Bigger projects move to Biome (rust-based, faster, replaces both) — try it in 2026 if you're greenfield.
ESLint and Prettier solve different problems and should be understood as separate tools: ESLint enforces code quality rules (unused variables, missing return types, potential bugs) while Prettier enforces formatting (indentation, quote style, line length) — and mixing them up produces redundant rules and confusing conflicts. The correct integration is eslint-config-prettier to disable all ESLint formatting rules, letting Prettier own formatting entirely. Gating both on CI with failing exit codes means style drift and code quality issues get caught before they land in the repository, not during code review.
pnpm add -D eslint @eslint/js typescript-eslint. Create eslint.config.js (flat config). Run pnpm eslint ..pnpm add -D prettier. Run pnpm prettier --write . on a file with messy formatting.pnpm add -D @biomejs/biome && pnpm biome check .. Note it's faster and config-light.Use these three in order. Each builds on the one before.
In one paragraph, explain why JS/TS still uses ESLint + Prettier (vs Go/Rust having one tool) — and what each does.
How does ESLint's flat config (v9+) differ from the legacy `.eslintrc.js`? Walk me through the resolution model.
For a fresh project in 2026, should I pick Biome over ESLint+Prettier? Compare on perf, ecosystem, and feature parity (with the typescript-eslint plugin set).
# install (pnpm):
$ pnpm add -D eslint @eslint/js typescript-eslint prettier
# eslint.config.js (flat config — ESLint 9+):
import js from "@eslint/js";
import tseslint from "typescript-eslint";
export default tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
{ rules: { "no-console": "warn" } }
);
# .prettierrc:
{
"semi": true,
"singleQuote": true,
"trailingComma": "all"
}
# scripts:
"lint": "eslint .",
"format": "prettier --write .",
"format:check": "prettier --check .",
# typical CI:
$ pnpm lint && pnpm format:check
# 2026 alternative — Biome (rust, replaces both):
$ pnpm add -D --save-exact @biomejs/biome
$ pnpm biome check .node main.js