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

prefer-const: don't treat index signatures as parameters #3385

Merged
merged 1 commit into from
Nov 28, 2017
Merged

prefer-const: don't treat index signatures as parameters #3385

merged 1 commit into from
Nov 28, 2017

Conversation

ajafff
Copy link
Contributor

@ajafff ajafff commented Oct 23, 2017

PR checklist

  • Addresses an existing issue: #0000
  • New feature, bugfix, or enhancement
    • Includes tests
  • Documentation update

Overview of change:

The k in {[k: string]: string} is a ts.ParameterDeclaration. It must not be treated like a parameter in the value domain.
IIRC I fixed a similar bug while rewriting no-shadowed-variable.

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

CHANGELOG.md entry:

[bugfix] prefer-const false negative with index signature named like a variable

The `k` in `{[k: string]: string}` is a `ts.ParameterDeclaration`. This should not be treated like a parameter in the value domain.
@adidahiya adidahiya self-assigned this Oct 31, 2017
@adidahiya adidahiya merged commit ada8c89 into palantir:master Nov 28, 2017
HyphnKnight pushed a commit to HyphnKnight/tslint that referenced this pull request Apr 9, 2018
The `k` in `{[k: string]: string}` is a `ts.ParameterDeclaration`. This should not be treated like a parameter in the value domain.
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.

None yet

2 participants