0
Challenge · 81Tooling & Quality

ESLint

Toolused in ~90% of apps

Half the React bugs you'd ship — a stale value because an effect dependency is missing, a crash because a hook hides behind an if — never have to reach runtime. ESLint reads your code without running it and flags them by name, the moment you type them.

Core idea. ESLint is a static analyzer: it parses your source into a tree and runs rules over it to catch likely bugs and bad patterns before the code ever runs. For React, the must-have rules live in eslint-plugin-react-hooks: rules-of-hooks (hooks called unconditionally, top level) and exhaustive-deps (effect/memo dependency arrays list everything they use).
Playground, this isn't a screenshot
Title.jsx
1function Title({ name }) {
2 useEffect(() => {
3 document.title = `Hi ${name}`;
4 }, []);
5}
1 warning (eslint)
warningreact-hooks/exhaustive-deps

React Hook useEffect has a missing dependency: 'name'. Either include it or remove the dependency array.

ESLint reads your code without running it(static analysis) and flags each violation with the exact rule name — here, the two rules from eslint-plugin-react-hooks.

↑ play a little first, then dig in