Files
Pete Bacon Darwin bd2e66cf2b build(docs-infra): ensure that terminal code snippets render correctly (#41994)
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 #41994
2021-05-10 10:31:14 -04:00

31 lines
1.6 KiB
Markdown

# 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:
* Enables [`strict` mode in TypeScript](https://www.typescriptlang.org/tsconfig#strict), as well as other strictness flags recommended by the TypeScript team. Specifically, `forceConsistentCasingInFileNames`, `noImplicitReturns`, `noFallthroughCasesInSwitch`.
* Turns on strict Angular compiler flags [`strictTemplates`](guide/angular-compiler-options#stricttemplates), [`strictInjectionParameters`](guide/angular-compiler-options#strictinjectionparameters) and [`strictInputAccessModifiers`](guide/template-typecheck#troubleshooting-template-errors).
* [Bundle size budgets](guide/build#configuring-size-budgets) have been reduced by ~75%.
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:
<code-example language="sh">
ng new [project-name] --strict
</code-example>
To create a new application in the strict mode within an existing non-strict workspace, run the following command:
<code-example language="sh">
ng generate application [project-name] --strict
</code-example>