You met the Lantern Street Theatre’s ticketing pages half typed, with strict off. Now they’re strict TypeScript, checked and linted.
In This Course, You Learned How To
- Configure a TypeScript project
- Migrate an existing JavaScript project to strict TypeScript in working steps
- Type the DOM and a project’s packages
- Check it with
tscand typescript-eslint in a Vite project - Find where types lie in code someone else wrote
- Build a typed program from a brief without a walkthrough
Things to Remember
- Checked before it runs, then the types are erased. The checker reads your code first. Then the types are removed, and plain JavaScript runs.
- Vite and Node don’t check:
npm run checkdoes. They strip the types without checking them, so your check script is what stops a type error. - Leaves first, one strict flag at a time. Migrate from the leaves inward, and get the check passing after each step.
- A known gap:
// @ts-expect-error: reason. Mid-migration, mark a gap you can’t close yet with the comment and its reason, and clear it before you call the project done. - A clean check can still hide
as,!andany. Replace each with a check or a precise type.