Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Disable failing custom lint rules #292

Merged
merged 1 commit into from
May 28, 2020

Conversation

sandersn
Copy link
Member

Not sure why they fail yet -- I'll investigate on Friday.

Some others may fail too, but these two are the worst offenders.

Not sure why they fail yet -- I'll investigate on Friday.

Some others may fail too, but these two are the worst offenders.
@andrewbranch andrewbranch merged commit b0fe763 into master May 28, 2020
@andrewbranch andrewbranch deleted the disable-failing-custom-lint-rules branch May 28, 2020 00:32
@IvanGoncharov
Copy link
Contributor

@sandersn @andrewbranch I investigated it since we experienced this problem in graphql-js repo:
https://github.com/graphql/graphql-js/blob/7a327a6e2045e75c577be924694e6642d3e28e14/src/tslint.json#L6-L7

It happens because dtslint and tslint use different typescript packages you can check this with npm ls typescript here is our output:

[email protected] /Users/ivang/dev/graphql-js
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]  deduped
│ └── [email protected]
└── [email protected]

So tslint produce AST with an older version of typescript and pass it to the dtslint custom rules that check kind values against enum from a newer typescript package, for example:

case ts.SyntaxKind.ArrowFunction:
case ts.SyntaxKind.CallSignature:
case ts.SyntaxKind.FunctionDeclaration:
case ts.SyntaxKind.FunctionExpression:
case ts.SyntaxKind.FunctionType:
case ts.SyntaxKind.MethodDeclaration:
case ts.SyntaxKind.MethodSignature:
return true;
default:
return false;

@IvanGoncharov
Copy link
Contributor

Also, it looks like a long-standing issue and it was reported in #281

@ExE-Boss
Copy link
Contributor

I’ve implemented a workaround in DefinitelyTyped/DefinitelyTyped#45148.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants