refactor(compiler-cli): improve error message formatting (#45827)

Changes the message from:

```
The component 'HelloComponent' appears in 'imports', but is not standalone
and cannot be imported directly It must be imported via an NgModule.
```
to

```
The component 'HelloComponent' appears in 'imports', but is not standalone
and cannot be imported directly. It must be imported via an NgModule.
```

PR Close #45827
This commit is contained in:
JoostK
2022-04-30 12:42:21 +02:00
committed by Dylan Hunn
parent 9cfea3d522
commit 3ebf9e7442
@@ -31,7 +31,7 @@ export function makeNotStandaloneDiagnostic(
let message = `The ${kind} '${
ref.node.name
.text}' appears in 'imports', but is not standalone and cannot be imported directly`;
.text}' appears in 'imports', but is not standalone and cannot be imported directly.`;
let relatedInformation: ts.DiagnosticRelatedInformation[]|undefined = undefined;
if (scope !== null && scope.kind === ComponentScopeKind.NgModule) {
// The directive/pipe in question is declared in an NgModule. Check if it's also exported.