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

NoStringBasedSetTimeoutTests false positive #285

Closed
anvish opened this issue Sep 28, 2016 · 4 comments
Closed

NoStringBasedSetTimeoutTests false positive #285

anvish opened this issue Sep 28, 2016 · 4 comments
Labels
Difficulty: Medium People with non-trivial experience in TSLint should be able to send a pull request for this issue. Requires Type Checker Must be implemented with a "typed" rule that uses a TypeScript program. Status: Accepting PRs Type: Bug

Comments

@anvish
Copy link

anvish commented Sep 28, 2016

new Promise(resolve => window.setTimeout(resolve, 100))

@HamletDRC HamletDRC added Type: Bug Requires Type Checker Must be implemented with a "typed" rule that uses a TypeScript program. labels Sep 30, 2016
@HamletDRC
Copy link
Member

The typechecker used in tslint is by default not aware of types. (it doesn't do much at all). So even though eslib.d.ts defines resolve as a function type, the tslint rule has no idea what the type of resolve is.

What we need to do to fix this is:

I will tag this "blocked on typechecker"

@connor4312
Copy link
Member

I'm unsure if this is the same core issue, but this rule has issue with calls to request.setTimeout as well.

@HamletDRC
Copy link
Member

Yes, it is the same issue. Our current approach is to be "better safe than sorry" and flag anything that is clearly not a function. We plan to upgrade the rule at some point. We just had a big push to get a bunch of accessibility rules done, so I think everyone is taking a small break before giving it some more effort.

@JoshuaKGoldberg JoshuaKGoldberg added Status: Accepting PRs Difficulty: Medium People with non-trivial experience in TSLint should be able to send a pull request for this issue. Type: Rule Feature Adding a feature to an existing rule. and removed Type: Rule Feature Adding a feature to an existing rule. labels Jul 18, 2018
@JoshuaKGoldberg
Copy link

💀 It's time! 💀

TSLint is deprecated and no longer accepting pull requests other than security fixes. See #876. ☠️
We recommend you instead use typescript-eslint to lint your TypeScript code with ESLint. ✅

👋 It was a pleasure open sourcing with you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Difficulty: Medium People with non-trivial experience in TSLint should be able to send a pull request for this issue. Requires Type Checker Must be implemented with a "typed" rule that uses a TypeScript program. Status: Accepting PRs Type: Bug
Projects
None yet
Development

No branches or pull requests

4 participants