Skip to content

Commit cd40568

Browse files
committed
fix(compiler-cli): fix up spelling of diagnostic
Fixes the spelling for the `component is missing a template` diagnostic and expands it a bit. (cherry picked from commit 3a26244)
1 parent 263e729 commit cd40568

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

packages/compiler-cli/src/ngtsc/annotations/component/src/resources.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ export function parseTemplateDeclaration(
433433
throw new FatalDiagnosticError(
434434
ErrorCode.COMPONENT_MISSING_TEMPLATE,
435435
decorator.node,
436-
'component is missing a template',
436+
'@Component is missing a template. Add either a `template` or `templateUrl`',
437437
);
438438
}
439439
}

packages/compiler-cli/test/ngtsc/ngtsc_spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7780,7 +7780,9 @@ runInEachFileSystem((os: string) => {
77807780
);
77817781

77827782
const diags = await driveDiagnostics();
7783-
expect(diags[0].messageText).toBe('component is missing a template');
7783+
expect(diags[0].messageText).toBe(
7784+
'@Component is missing a template. Add either a `template` or `templateUrl`',
7785+
);
77847786
expect(diags[0].file!.fileName).toBe(absoluteFrom('/test.ts'));
77857787
});
77867788

packages/language-service/test/diagnostic_spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ describe('getSemanticDiagnostics', () => {
285285

286286
const project = createModuleAndProjectWithDeclarations(env, 'test', files);
287287
const diags = project.getDiagnosticsForFile('app.ts');
288-
expect(diags.map((x) => x.messageText)).toEqual(['component is missing a template']);
288+
expect(diags.map((x) => x.messageText)).toEqual([
289+
'@Component is missing a template. Add either a `template` or `templateUrl`',
290+
]);
289291
});
290292

291293
it('reports a warning when the project configuration prevents good type inference', () => {

0 commit comments

Comments
 (0)