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

use astUtils.getStaticPropertyName in no-prototype-builtins #13088

Closed
mdjermanovic opened this issue Mar 25, 2020 · 5 comments
Closed

use astUtils.getStaticPropertyName in no-prototype-builtins #13088

mdjermanovic opened this issue Mar 25, 2020 · 5 comments
Assignees

Comments

@mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Mar 25, 2020

What rule do you want to change?

no-prototype-builtins

Does this change cause the rule to produce more or fewer warnings?

more

How will the change be implemented? (New option, new default behavior, etc.)?

new default behavior

Please provide some example code that this change will affect:

/*eslint no-prototype-builtins: "error"*/

var hasBarProperty = foo["hasOwnProperty"]("bar");

var isPrototypeOfBar = foo['isPrototypeOf'](bar);

var barIsEnumerable = foo[`propertyIsEnumerable`]("bar");

What does the rule currently do for this code?

no errors

What will the rule do after it's changed?

3 errors

Are you willing to submit a pull request to implement this change?

Yes.

@kaicataldo
Copy link
Member

@kaicataldo kaicataldo commented Mar 25, 2020

I would argue that this is a bug in the current rule.

@mdjermanovic
Copy link
Member Author

@mdjermanovic mdjermanovic commented Mar 26, 2020

I'd also agree with treating this issue as a bug.

@nanbeinanbei
Copy link

@nanbeinanbei nanbeinanbei commented Sep 1, 2020

when can we get it changed?

@btmills btmills added accepted and removed evaluating labels Oct 12, 2020
@btmills
Copy link
Member

@btmills btmills commented Oct 12, 2020

This is now accepted, and I agree we can treat it as a semver-minor bug fix.

@mdjermanovic
Copy link
Member Author

@mdjermanovic mdjermanovic commented Oct 12, 2020

I'm working on this.

mdjermanovic added a commit that referenced this issue Oct 13, 2020
mdjermanovic added a commit that referenced this issue Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.