angular/packages/compiler-cli/test
Doug Parker 83e6db4081 refactor(compiler-cli): add validation to extended template diagnostics configuration (#44391)
Refs #42966.

This validates the `tsconfig.json` options for extended template diagnostics. It verifies:
* `strictTemplates` must be enabled if `extendedDiagnostics` have any explicit configuration.
* `extendedDiagnostics.defaultCategory` must be a valid `DiagnosticCategoryLabel`.
* `extendedDiagnostics.checks` keys must all be real diagnostics.
* `extendedDiagnostics.checks` values must all be valid `DiagnosticCategoryLabel`s.

These include new error codes, each of which prints out the exact property that was the issue and what the available options are to fix them.

It does disallow the config:

```json
{
  "angularCompilerOptions": {
    "strictTemplates": false,
    "extendedDiagnostics": {
      "defaultCategory": "suppress"
    }
  }
}
```

Such a configuration is technically valid and could be executed, but will be rejected by this verification logic. There isn't much reason to ever do this, since users could just drop `extendedDiagnostics` altogether and get the intended effect. This is unlikely to be a significant issue for users, so it is considered invalid for now to keep the implementation simple.

PR Close #44391
2022-01-11 17:33:16 +00:00
..
compliance feat(compiler): add support for safe calls in templates (#44580) 2022-01-11 17:32:47 +00:00
ngtsc refactor(compiler-cli): add validation to extended template diagnostics configuration (#44391) 2022-01-11 17:33:16 +00:00
BUILD.bazel build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
downlevel_decorators_transform_spec.ts fix(compiler-cli): downlevel transform incorrectly extracting constructor parameters for nested classes (#44281) 2021-11-30 11:56:05 -05:00
extract_i18n_spec.ts build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
mocks.ts refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
perform_compile_spec.ts refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
perform_watch_spec.ts refactor(compiler): delete View Engine components of @angular/compiler (#44368) 2021-12-06 13:12:36 -05:00
test_support.ts refactor(compiler): delete View Engine components of @angular/compiler (#44368) 2021-12-06 13:12:36 -05:00
typescript_support_spec.ts fix(compiler-cli): handle pre-release versions when checking version (#44109) 2021-11-09 20:54:45 +00:00
version_helpers_spec.ts refactor(compiler-cli): move version number helpers out of diagnostics subfolder (#44269) 2021-12-01 10:36:30 -08:00