Skip to content

Commit

Permalink
Add ts2719 to known errors (#220)
Browse files Browse the repository at this point in the history
Co-authored-by: Sindre Sorhus <[email protected]>
  • Loading branch information
mcollina and sindresorhus authored Sep 4, 2024
1 parent c01c9e0 commit 0660059
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/lib/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const expectErrorDiagnosticCodesToIgnore = new Set<DiagnosticCode>([
DiagnosticCode.AcceptsTooFewArgumentsToBeUsedAsDecoratorHere,
DiagnosticCode.PropertyDoesNotExistOnTypeDidYouMean,
DiagnosticCode.ErrorIsOfTypeUnknown,
DiagnosticCode.TwoDifferentTypesSameName,
]);

type IgnoreDiagnosticResult = 'preserve' | 'ignore' | Location;
Expand Down
1 change: 1 addition & 0 deletions source/lib/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export enum DiagnosticCode {
IndexSignatureOnlyPermitsReading = 2542,
NoOverloadExpectsCountOfArguments = 2575,
ThisContextOfTypeNotAssignableToMethodOfThisType = 2684,
TwoDifferentTypesSameName = 2719,
Type1IsMissingPropertiesFromType2Variant1 = 2739,
Type1IsMissingPropertiesFromType2Variant2 = 2740,
PropertyMissingInType1ButRequiredInType2 = 2741,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,16 @@ expectError(one('foo', 'bar'));

// 'Found an error that tsd does not currently support (`ts2304`), consider creating an issue on GitHub.'
expectError(undeclared = one('foo', 'bar'));

// ts2719
interface T {}
declare const a: T;
expectError(class Foo<T> {
x: T;
constructor(a: T) {
this.x = a;
}
fn() {
this.x = a;
}
})

0 comments on commit 0660059

Please sign in to comment.