Strictly Speaking
A Learning TypeScript > Configuration Options 🍲 entree project.
Salutations. I am Strictus Typus the Fourth, compiler of the Roman TypeScript armies. My legions are spreading rapidly through the content, conquering as they go.
The masses long for inspiration. Thus it is inspiration I must give them.
Yet, I am not a leader through speech. I am a leader through action. Of conquering soldiery. Of brave deeds and noble intentions, spoken softly so as to not sharply jut out with overt obviousness.
Will you repair for me this speechwriter program?
I fear it was originally written without TypeScript's --noImplicitAny
or --strictNullChecks
modes.
You must restore strict type safety -undefined
and all- that it may run justly and without type errors.
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/configuration-options/strictly-speaking
In a terminal, start the TypeScript compiler in watch mode:
tsc --watch
Files
index.ts
: Add type annotation shereindex.solution.ts
Solution code
Notes
- Don't use
any
or leave any implicitany
s. - Don't change any runtime code behavior. You're just working in the type system.