In the latest version of Angular, Angular 10, a new strict opt-in mode was added in order to optimize build times and deliver apps faster with fewer problems. 

Currently, this new feature is still in opt-in mode because it comes with a few trade-offs, including stricter type checking and extra configuration.

RELATED CONTENT: Angular 10 now available

According to Angular, there are a few settings that need to be turned on in addition to default settings to create an app that uses strict mode. These include:

  • Enabling strict mode in TypeScript
  • Turning on strict Angular compiler flags strictTemplates and strictInjectionParameters
  • Reducing bundle size budgets by 75%
  • Turning on no-any TSLint rule to prevent declarations of type any
  • Marking the application as side-effect free

The Angular team noted that there are trade-offs for each of these. For more information on each, visit Angular’s post.