fix(compiler-cli): suppress inheritance errors for metadata in preprocessor

Fixes an issue that popped up internally where if we generated `ctorParameters` or `propDecorators` for a base class, we end triggering a `noImplicitOverride` error on the child class. These changes resolve it by adding a `@ts-ignore`.
This commit is contained in:
Kristiyan Kostadinov
2026-10-30 14:18:56 +01:00
committed by Kristiyan Kostadinov
parent c7bcc2e3b8
commit 393ec969e8
6 changed files with 248 additions and 86 deletions
@@ -566,7 +566,8 @@ export function processFileSync(
const nocollapse = ctx.isClosureCompilerEnabled ? '/** @nocollapse */\n ' : '';
s.appendLeft(
span.end - 1,
`\n ${nocollapse}static ctorParameters = ${printer.print(ctorExpr)};\n`,
// ts-ignore is necessary to suppress errors if the base class has `ctorParameters`.
`\n ${nocollapse}// @ts-ignore\n static ctorParameters = ${printer.print(ctorExpr)};\n`,
);
}
@@ -597,7 +598,8 @@ export function processFileSync(
const nocollapse = ctx.isClosureCompilerEnabled ? '/** @nocollapse */\n ' : '';
s.appendLeft(
span.end - 1,
`\n ${nocollapse}static propDecorators = ${printer.print(propExpr)};\n`,
// ts-ignore is necessary to suppress errors if the base class has `propDecorators`.
`\n ${nocollapse}// @ts-ignore\n static propDecorators = ${printer.print(propExpr)};\n`,
);
}
}
@@ -23,6 +23,7 @@ export class FullDir extends BaseDir {
ngOnChanges() {}
// @ts-ignore
static ctorParameters = (): any => [
{
/* @ts-ignore */
@@ -42,6 +42,7 @@ export class FullDir extends BaseDir {
ngOnChanges() {}
// @ts-ignore
static ctorParameters = (): any => [{ type: TemplateRef }];
}
@@ -32,6 +32,7 @@ export class JitCtorComponent {
@CustomParamDec() public dep: DepService = new DepService(),
) {}
// @ts-ignore
static ctorParameters = (): any => [
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [TOKEN] }] },
{ type: Number },
@@ -32,6 +32,7 @@ export class JitCtorComponent {
@CustomParamDec() public dep: DepService = new DepService(),
) {}
// @ts-ignore
static ctorParameters = (): any => [
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [TOKEN] }] },
{ type: Number },
File diff suppressed because it is too large Load Diff