Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ts18046 to known errors #211

Merged
merged 2 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions source/lib/compiler.ts
Expand Up @@ -57,6 +57,7 @@ const expectErrorDiagnosticCodesToIgnore = new Set<DiagnosticCode>([
DiagnosticCode.RuntimeWillInvokeDecoratorWithXArgumentsButDecoratorExpectsAtLeastY,
DiagnosticCode.AcceptsTooFewArgumentsToBeUsedAsDecoratorHere,
DiagnosticCode.PropertyDoesNotExistOnTypeDidYouMean,
DiagnosticCode.ErrorIsOfTypeUnknown,
]);

type IgnoreDiagnosticResult = 'preserve' | 'ignore' | Location;
Expand Down
1 change: 1 addition & 0 deletions source/lib/interfaces.ts
Expand Up @@ -66,6 +66,7 @@ export enum DiagnosticCode {
MemberCannotHaveOverrideModifierBecauseItIsNotDeclaredInBaseClass = 4113,
MemberMustHaveOverrideModifier = 4114,
NewExpressionTargetLackingConstructSignatureHasAnyType = 7009,
ErrorIsOfTypeUnknown = 18046,
}

export interface Diagnostic {
Expand Down
4 changes: 3 additions & 1 deletion source/test/fixtures/expect-error/values/index.test-d.ts
Expand Up @@ -13,7 +13,9 @@ try {
expectError(foo.bar = 'quux');
expectError(foo.quux);
}
} catch {}
} catch (error) {
expectError(error.code);
}

expectError(hasProperty({name: 1}));

Expand Down
7 changes: 6 additions & 1 deletion source/test/fixtures/expect-error/values/package.json
@@ -1,3 +1,8 @@
{
"name": "foo"
"name": "foo",
"tsd": {
"compilerOptions": {
"useUnknownInCatchVariables": true
}
}
}