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

id-blacklist doesn't warn when renaming properties to blacklisted identifiers in destructuring assignment. #12807

Closed
jpramassini opened this issue Jan 19, 2020 · 6 comments · Fixed by #12923
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly good first issue Good for people who haven't worked on ESLint before help wanted The team would welcome a contribution from the community for this issue regression Something broke rule Relates to ESLint's core rules

Comments

@jpramassini
Copy link
Contributor

Tell us about your environment

  • ESLint Version: 7.0.0 (upcoming)
  • Node Version: 10.15.3
  • npm Version: 6.4.1

What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:

Configuration
id-blacklist: ["foo", "bar"] // Rule options

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

const {foo: bar} = baz

What did you expect to happen?
ESLint should warn that bar is a blacklisted identifier, but not foo as it is a property from the original baz object.

What actually happened? Please include the actual, raw output from ESLint.
There is no warning for either identifier.

Context for this: A recent PR bugfix removed the errant warning on properties that were being renamed (foo in the example above). In the course of this it ignores the following blacklisted bar identifier. This is a follow up to #12792.

Are you willing to submit a pull request to fix this bug?
Yes

@jpramassini jpramassini added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Jan 19, 2020
@mdjermanovic mdjermanovic added accepted There is consensus among the team that this change meets the criteria for inclusion regression Something broke rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Jan 19, 2020
@mdjermanovic
Copy link
Member

Thanks!

If I understand correctly, this is a regression introduced in #12792.

@jpramassini
Copy link
Contributor Author

That's correct. After working with @kaicataldo on it, he suggested that these two issues with the rule be resolved in separate issues/PRs.

@mdjermanovic
Copy link
Member

Thanks for the follow-up issue! Marked as accepted.

In addition to the original example, I think the following should be also a warning (when foo is blacklisted):

const { foo } = baz;

@mdjermanovic
Copy link
Member

Just to check as it would be nice to fix this for v7.0.0 - is anyone working on this? :)

@kaicataldo kaicataldo added help wanted The team would welcome a contribution from the community for this issue good first issue Good for people who haven't worked on ESLint before labels Feb 16, 2020
@kaicataldo
Copy link
Member

I don't think so!

@yeonjuan
Copy link
Member

If there is no one working on, I will try. : )

kaicataldo pushed a commit that referenced this issue Feb 19, 2020
…#12923)

* Update: report rename id destructuring in id-blacklist (fixes #12807)

* check RestElement, ArrayPattern, computed

* check assignment pattern, computed property

* add option

* remove dupe condition
montmanu pushed a commit to montmanu/eslint that referenced this issue Mar 4, 2020
…12807) (eslint#12923)

* Update: report rename id destructuring in id-blacklist (fixes eslint#12807)

* check RestElement, ArrayPattern, computed

* check assignment pattern, computed property

* add option

* remove dupe condition
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Aug 19, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Aug 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly good first issue Good for people who haven't worked on ESLint before help wanted The team would welcome a contribution from the community for this issue regression Something broke rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants