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:
bash
ng new [project-name] --strict
To create a new application in the strict mode within an existing non-strict workspace, run the following command:
bash
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
any
- Configures your app as side-effect free to enable more advanced tree-shaking
Get More tutorials on Angular 10