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

[no-proto, no-iterator] overlooks template literal #12801

Closed
yeonjuan opened this issue Jan 17, 2020 · 1 comment
Closed

[no-proto, no-iterator] overlooks template literal #12801

yeonjuan opened this issue Jan 17, 2020 · 1 comment
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 rule Relates to ESLint's core rules

Comments

@yeonjuan
Copy link
Member

yeonjuan commented Jan 17, 2020

Tell us about your environment

  • ESLint Version: v6.8.0
  • Node Version: v12.13.0
  • npm Version: v6.12.0

What parser (default, Babel-ESLint, etc.) are you using?

default

Please show your full configuration:

Configuration

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

Demo - no-proto

/*eslint no-proto: "error"*/
var a = obj["__proto__"];
var a = obj[`__proto__`];

Demo - no-iterator

/*eslint no-iterator: "error"*/
foo["__iterator__"] = function () {};
foo[`__iterator__`] = function () {};

What did you expect to happen?

Both cases are expected two errors each.

What actually happened? Please include the actual, raw output from ESLint.

Both rules(no-proto, no-iterator) don't consider template literals.

  • no-proto
/*eslint no-proto: "error"*/
var a = obj["__proto__"]; // Error - The '__proto__' property is deprecated
var a = obj[`__proto__`]; // no error.
  • no-iterator
/*eslint no-iterator: "error"*/
foo["__iterator__"] = function () {}; // Error - Reserved name '__iterator__'/
foo[`__iterator__`] = function () {}; // no error

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

Yes (it's prepared)

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

confirmed, thanks!

montmanu pushed a commit to montmanu/eslint that referenced this issue Mar 4, 2020
…#12801) (eslint#12806)

* Fix: check template literal prop in no-proto (eslint#12801)

* Fix: check template literal prop in no-iterator (eslint#12801)

* add test cases
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Jul 28, 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 Jul 28, 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 rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

2 participants