Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

TypeScript in a Real Project: Configure, Migrate and Ship (Summary)

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 tsc and 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 check does. 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, ! and any. Replace each with a check or a precise type.

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

00:00 You met the theater’s ticketing pages half typed, with strict off. Now they’re strict, checked and linted. Here’s what you can do. You configure a TypeScript project for where its code runs.

00:12 You migrate an existing JavaScript project to strict TypeScript in working steps. You type the DOM and a project’s packages. You check it with tsc and typescript-eslint in a Vite project.

00:25 You find where types lie in code someone else wrote, an AI assistant’s included. And you build a typed program from a brief, without a walkthrough.

00:36 The checker reads your code before it runs. Then the types are erased, and plain JavaScript runs. Vite and Node strip the types without checking them, so your check script stops a type error.

00:49 Migrate from the leaves inward, and turn strict on one flag at a time. Keep the check passing after each step. Mark a gap you can’t close yet with a @ts-expect-error comment and a reason.

01:01 And an as assertion, a non-null assertion or an any can hide behind a clean check. Replace each with a check or a precise type.

01:11 This course ends the TypeScript path, so what comes next is your own code. Keep growing the program you planned, one feature at a time. Then migrate a JavaScript project you already have, the way you migrated the theater’s pages.

01:25 Starting something new means deciding whether it needs types from day one. The RealJS tutorial on when to add types can help you decide.

01:35 Well done on finishing the path, and thanks for watching.

Become a Member to join the conversation.