angular-cn/aio/content/guide/strict-mode.md
Alan Agius bd5e425c14 docs: update CLI strict mode documentation (#39054)
With this change we update the strict mode documentation to reflect the
changes done in the CLI. (https://github.com/angular/angular-cli/pull/18931)

Changes effect
- Removing `no-any` tslint rule
- The special sideEffects  package.json
- Added `strictTemplates` NGC option

PR Close #39054
2020-09-30 12:51:26 -07:00

1.7 KiB

Strict mode

When you create a new workspace or an application you have an option to create them in a strict mode using the --strict flag.

Enabling this flag initializes your new workspace or application with a few new settings that improve maintainability, help you catch bugs ahead of time. Additionally, applications that use these stricter settings are easier to statically analyze, which can help the ng update command refactor code more safely and precisely when you are updating to future versions of Angular.

Specifically, the strict flag does the following:

You can apply these settings at the workspace and project level.

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