Tests are not your only checker. There are others, they never get tired, and you have
already installed most of them.

What each one catches

The TypeScript compiler catches whole groups of mistakes before anything runs: a
function called with the wrong things, a value that might be missing, a name spelled wrong.

A linter catches unused code, unreachable code, and patterns that are usually accidents.

A formatter ends all arguments about layout, which matters more than it sounds, because
an agent that reformats a file makes a small change look enormous and unreviewable.

Why this matters much more with agents

Every check you add is a check the agent runs on itself.

Turning on a stricter compiler setting is not just about you catching more mistakes. It is
about the agent catching its own mistakes before it ever shows you anything. You are
improving its eyesight.

Turn the settings up

In tsconfig.json, if this is not already on:

{
  "compilerOptions": {
    "strict": true
  }
}

strict mostly means: do not let something be missing without saying so. That single
setting prevents a large share of real-world crashes, and it is exactly the kind of detail
an agent handles well once it is told.

Put everything behind one command

{
  "scripts": {
    "test": "tsc --noEmit && eslint . && node --test"
  }
}

Now npm test type-checks, lints and runs the tests. One command, everything checked, and
the agent runs all of it every time.

This is a five-minute change that improves every future session in the project.

A warning about turning strict on later

If you switch strict on in an existing project, you may get a hundred errors at once, and
“fix all the type errors” is a large, boring, risky change to review.

Do it early, on a small project. Recall is small. Do it now.

Try this before the next lesson

  1. Add "strict": true if it is not there. How many errors appear? Fix them in one commit,
    on their own.
  2. Make npm test run the type check as well.
  3. Write code that passes the tests but does not compile. Confirm npm test now fails.