In this tutorial, we will see what is the Best Way to Setup Angular 10 Project using Strict . In angular 10, we can set up a project with strict settings using the
--strict flag. These settings help improve maintainability, catch bugs ahead of time, and allow the Angular CLI to perform advanced optimizations for your app.
Setup Strict Angular 10 Project
To create a new workspace and application using the strict mode, run the following command:
ng new [project-name] --strict
To create a new application in the strict mode within an existing non-strict workspace, run the following command:
ng generate application [project-name] --strict
Specifically, the strict flag does the following things.
- Enables strict mode in TypeScript
- Turns template type checking to Strict
- Reduces default bundle budgets by as much as 75 %
- Configures linting rules to prevent declarations of type
- Configures your app as side-effect free to enable more advanced tree-shaking