Skip to Content
Learning TypeScript 2.x - Second Edition
book

Learning TypeScript 2.x - Second Edition

by Remo H. Jansen
April 2018
Beginner content levelBeginner
536 pages
13h 21m
English
Packt Publishing
Content preview from Learning TypeScript 2.x - Second Edition

The --strict mode

TypeScript allows us to use the --strict compilation flag to enable all strict type checking options. Enabling --strict enables --noImplicitAny, --noImplicitThis, --alwaysStrict, --strictPropertyInitialization, and --strictNullChecks:

  • The --strictNullChecks compilation flag enables non-nullable types.
  • The --noImplicitAny flag forces us to explicitly declare the type of a variable when the type inference system is not able to automatically infer the correct type.
  • The --alwaysStrict flag forces the TypeScript parse to use the strict mode.
  • The --noImplicitThis flag forces us to explicitly declare the type of the this operator in functions when the type inference system is not able to automatically infer the correct type.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering TypeScript - Fourth Edition

Mastering TypeScript - Fourth Edition

Nathan Rozentals
Learning TypeScript

Learning TypeScript

Josh Goldberg
TypeScript for Beginners

TypeScript for Beginners

Bharath Thippireddy

Publisher Resources

ISBN: 9781788391474Supplemental Content