Skip to content

Commit 700679e

Browse files
Add ts18046 to known errors (#211)
1 parent e27e031 commit 700679e

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

source/lib/compiler.ts

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const expectErrorDiagnosticCodesToIgnore = new Set<DiagnosticCode>([
5757
DiagnosticCode.RuntimeWillInvokeDecoratorWithXArgumentsButDecoratorExpectsAtLeastY,
5858
DiagnosticCode.AcceptsTooFewArgumentsToBeUsedAsDecoratorHere,
5959
DiagnosticCode.PropertyDoesNotExistOnTypeDidYouMean,
60+
DiagnosticCode.ErrorIsOfTypeUnknown,
6061
]);
6162

6263
type IgnoreDiagnosticResult = 'preserve' | 'ignore' | Location;

source/lib/interfaces.ts

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export enum DiagnosticCode {
6666
MemberCannotHaveOverrideModifierBecauseItIsNotDeclaredInBaseClass = 4113,
6767
MemberMustHaveOverrideModifier = 4114,
6868
NewExpressionTargetLackingConstructSignatureHasAnyType = 7009,
69+
ErrorIsOfTypeUnknown = 18046,
6970
}
7071

7172
export interface Diagnostic {

source/test/fixtures/expect-error/values/index.test-d.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ try {
1313
expectError(foo.bar = 'quux');
1414
expectError(foo.quux);
1515
}
16-
} catch {}
16+
} catch (error) {
17+
expectError(error.code);
18+
}
1719

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

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
{
2-
"name": "foo"
2+
"name": "foo",
3+
"tsd": {
4+
"compilerOptions": {
5+
"useUnknownInCatchVariables": true
6+
}
7+
}
38
}

0 commit comments

Comments
 (0)