A strict project you can trust
Configure the compiler so it catches bugs instead of adding ceremony.
What you will be able to do
- Start with strict: true and fix errors instead of weakening the setting.
- Use noEmit for type checking and let your bundler handle output.
- Separate application code from tests and build output with include and exclude.
In plain English
TypeScript only helps as much as your configuration allows. Strict mode, noUncheckedIndexedAccess and consistent module settings remove whole categories of runtime surprises. Run type checking in CI, not only in your editor.
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"strict": true,
"noUncheckedIndexedAccess": true,
"noEmit": true,
"skipLibCheck": true
},
"include": ["src"]
}Your turn
EasyMake the config strict
Add strict and noUncheckedIndexedAccess to a tsconfig. Explain which new error you would expect in a function that reads items[0].
JSON · starter
{
"compilerOptions": {}
}Check your understanding before moving on.
Knowledge checkQuestion 1
What does noEmit do?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.