Skip to main content

The Typeinator

A Learning TypeScript > From JavaScript to TypeScript 🥗 appetizer project. You'll practice converting legacy JavaScript code to use newer ECMAScript syntax features.

Zap! Hiss... Bang!

A bolt of lightning strikes through the cloudless night. Whisks of smoke swirl around your feet, stepping out of the time travel orb onto the streets of Los Angeles. The year is 2004 and your mission is to prepare several JavaScript projects for the future of ECMAScript syntax features.

You are the Typeinator. 🤖

Setup

If you haven't yet, set up the github.com/LearningTypeScript/projects repository locally.

git clone https://github.com/LearningTypeScript/projects learning-typescript-projects
cd learning-typescript-projects
npm i

Change your terminal directory to this project's:

cd projects/from-javascript-to-typescript/the-typeinator

In one terminal, run the TypeScript compiler via the tsc script within whichever step you're working on. For example, to start the TypeScript compiler on the first step in watch mode:

shell
npm run tsc -- --project 01-prototypes-to-classes --watch
shell
npm run tsc -- --project 01-prototypes-to-classes --watch

In another terminal, run Jest via the test script on whichever step you're working on. For example, to start tests for the first step in watch mode:

shell
npm run test -- 1 --watch
shell
npm run test -- 1 --watch

Steps

Notes

  • Don't import code from one step into another.