The turkey page lists every pickup day’s deadline and every size’s price, and the week’s three issues are closed. Along the way, the store’s site picked up a formatter and a linter, and every change reached main through a pull request that you opened, read, and merged on GitHub.
This summary collects the habits from this course in one place, so you can come back to them when you start a new branch, open a pull request, or review someone else’s code. Start with the two tools that now check every change.
Format First, Then Lint
A formatter and a linter answer different questions, and the course set them up in that order on purpose. Prettier decides how code looks, and ESLint points out code that’s likely wrong. Here’s what to keep from each:
-
Prettier changes how code is laid out and leaves its behavior unchanged. It’s pinned to one exact version, so every copy of the project formats the same way, with its options in
.prettierrcand the files it skips in.prettierignore. -
A project-wide reformat gets a commit of its own, with a message that says it only changes layout. A reviewer can then skip it and read the other changes.
-
ESLint reads code without running it.
eslint.config.jsstarts from the recommended rules and sets the globals for each part of the project: browser globals forsrc/and Node for the scripts and config files. -
Each line of a lint report names the file, line, column, message, and rule.
--fixonly repairs what a rule can fix safely. A disable comment needs a reason after--that the team agrees on. -
Both tools exit with an error when a check fails, so
npx prettier --check .,npm run lint, andnpm run checkcan tell pass from fail without a person reading the output. Prettier fails on any formatting difference; ESLint fails on errors, and by default not on warnings, which only show up in the report.
The closing-soon notice showed where these tools stop. Prettier wrapped if (today.closed = !today.closed) in a second pair of parentheses. Those parentheses tell ESLint the assignment is intentional, so a clean report let the bug through.
A linter only checks patterns and can’t tell what the code is for, so you still call a function with fixed values and look at what it returns before you rely on it.