angular-cn/aio/content/guide/strict-mode.md
Pete Bacon Darwin 3a48c0739d build(docs-infra): ensure that terminal code snippets render correctly (#41986)
After the changes to the `lang-none` styling in #41335, code snippets marked with

```
language="none" class="code-shell"
```

were being styled with the same foreground and background colours.

It turns out that most of these ought to be marked `language="sh"`
in which case the `code-shell` style became redundant and has been
removed.

Fixes #41984

PR Close #41986
2021-05-07 13:11:04 -04:00

1.5 KiB

Strict mode

Angular CLI creates all new workspaces and projects with strict mode enabled.

Strict mode improves maintainability and helps you catch bugs ahead of time. Additionally, strict mode applications are easier to statically analyze and can help the ng update command refactor code more safely and precisely when you are updating to future versions of Angular.

Specifically, strict mode does the following:

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

Using the basic ng new command to create a new workspace and application automatically uses strict mode, as in the following command:

ng new [project-name]

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