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

Update the no-proto rule documentation #11743

Closed
fasttime opened this issue May 19, 2019 · 1 comment
Closed

Update the no-proto rule documentation #11743

fasttime opened this issue May 19, 2019 · 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 documentation Relates to ESLint's documentation rule Relates to ESLint's core rules

Comments

@fasttime
Copy link
Member

The version of ESLint you are using.

5.16.0.

The problem you want to solve.

The documentation of the no-proto rule seems to be outdated as of today. I can point out three issues:

  • The documentation only suggests using getPrototypeOf method instead of __proto__. But getPrototypeOf cannot change the prototype of an object, and as such cannot be used to rewrite assignments to the __proto__ property, which the no-proto rule complains about.
  • The documentation says that "support for getPrototypeOf is not yet universal". Now getPrototypeOf (unlike setPrototypeOf) is part of ES 5.1 spec and is implemented in browsers as old as IE 9 and Safari 7.
  • There are two choices for getPrototypeOf: Object.get​PrototypeOf and Reflect​.getPrototypeOf, where the main difference is browser support. The documentation leaves this ambiguity open to the reader.

Your take on the correct solution to problem.

I'd be glad to submit a PR if the team agrees that the rule documentation needs to be updated.

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

Sure.

@fasttime fasttime added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels May 19, 2019
@platinumazure platinumazure added accepted There is consensus among the team that this change meets the criteria for inclusion documentation Relates to ESLint's documentation rule Relates to ESLint's core rules and removed core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels May 19, 2019
@platinumazure
Copy link
Member

Hi @fasttime, thanks for the issue!

This sounds like a reasonable and useful documentation improvement to me, and I would love to see a pull request!

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Nov 20, 2019
@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 Nov 20, 2019
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 documentation Relates to ESLint's documentation rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

2 participants