Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eslint-plugin): fix false positives for adjacent-overload-signatures regarding computed property names #340

Merged

Conversation

uniqueiniquity
Copy link
Contributor

Currently, the name of a method definition or a class property is always assumed to be a literal or an identifier. However, this fails to account for computed property names.
In those cases, we currently sometimes give the name for a method definition with a computed name as undefined, which as a result causes methods with differing computed property names to be marked as overloads of each other. In this PR, we slice the text of the computed property name out to handle these cases.

@uniqueiniquity uniqueiniquity changed the title Adjacent computed sigs fix(eslint-plugin): fix false positives for adjacent-overload-signatures regarding computed property names Mar 8, 2019
@codecov
Copy link

codecov bot commented Mar 8, 2019

Codecov Report

Merging #340 into master will decrease coverage by 0.03%.
The diff coverage is 90.9%.

@@            Coverage Diff             @@
##           master     #340      +/-   ##
==========================================
- Coverage   97.27%   97.24%   -0.04%     
==========================================
  Files          67       67              
  Lines        2348     2357       +9     
  Branches      335      336       +1     
==========================================
+ Hits         2284     2292       +8     
- Misses         43       44       +1     
  Partials       21       21
Impacted Files Coverage Δ
packages/eslint-plugin/src/rules/member-naming.ts 100% <100%> (ø) ⬆️
...-plugin/src/rules/explicit-member-accessibility.ts 100% <100%> (ø) ⬆️
...ackages/eslint-plugin/src/rules/member-ordering.ts 96.72% <100%> (+0.05%) ⬆️
...t-plugin/src/rules/adjacent-overload-signatures.ts 94.44% <100%> (+0.15%) ⬆️
packages/eslint-plugin/src/util/misc.ts 80% <80%> (ø) ⬆️

Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bradzacher bradzacher merged commit f6e5118 into typescript-eslint:master Mar 8, 2019
@uniqueiniquity uniqueiniquity deleted the adjacentComputedSigs branch March 8, 2019 18:07
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
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