Module lessons (1/2)
Configuration with tsconfig.json
Master strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, modern modules and targets.
What you'll learn in this lesson
- Master what exactly the
"strict": trueumbrella flag intsconfig.jsonenables. - Understand the actual bugs prevented by
strictNullChecks,noImplicitAnyanduseUnknownInCatchVariables. - Take advantage of the two most useful ultra-strict flags in real projects:
noUncheckedIndexedAccessandexactOptionalPropertyTypes. - Choose
"target","module"and"moduleResolution"wisely (e.g.bundlervsNodeNext).
Overview
tsconfig.json defines the rules by which tsc parses the project and outputs JavaScript. A weak tsconfig.json lets implicit any and unhandled undefined silently filter through; a strict one turns entire categories of production bugs into immediate red errors in the editor.
Enabling "strict": true activates a whole group of core guarantees in one fell swoop: noImplicitAny, strictNullChecks, strictFunctionTypes, strictBindCallApply, strictPropertyInitialization, and useUnknownInCatchVariables.
Sections covered in this lesson
- 1The package
"strict": true - 2Extra hardness flag over
strict - 3Guided practice
- 4Check for understanding
Unlock "Configuration with tsconfig.json" and the full Course TypeScript curriculum
Master strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, modern modules and targets.
Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in Course TypeScript plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.