Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

strict-type-predicates: allow comparing typeof with expression #3542

Merged
merged 2 commits into from
Jan 9, 2018
Merged

strict-type-predicates: allow comparing typeof with expression #3542

merged 2 commits into from
Jan 9, 2018

Conversation

ajafff
Copy link
Contributor

@ajafff ajafff commented Dec 3, 2017

PR checklist

Overview of change:

The rule didn't allow comparing typeof foo to anything but a string literal. Even NonSubstitutionTemplateLiteral was not allowed. This PR makes the rule less strict, but this doesn't really matter since the compiler already catches most errors.
[bugfix] strict-type-predicates allows comparing typeof result with non-literals
Fixes: #3508

Is there anything you'd like reviewers to focus on?

CHANGELOG.md entry:

[bugfix] `strict-type-predicates` allows comparing typeof result with non-literals
Fixes: #3508
@adidahiya adidahiya merged commit 18fc973 into palantir:master Jan 9, 2018
HyphnKnight pushed a commit to HyphnKnight/tslint that referenced this pull request Apr 9, 2018
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.

Bad comparison for 'typeof'
2 participants