-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionfeatureThis change adds a new feature to ESLintThis change adds a new feature to ESLintruleRelates to ESLint's core rulesRelates to ESLint's core rules
Description
Please describe what the rule should do:
ES2016 adds an exponentiation operator **
; this may be preferred over using Math.pow()
. The rule should disallow the use of the Math.pow()
function, in favor of using **
.
What category of rule is this? (place an "X" next to just one item)
[ ] Enforces code style
[ ] Warns about a potential error
[x] Suggests an alternate way of doing something
[ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about:
// Good
const a = 5 ** 7
// Bad
const a = Math.pow(5, 7)
Why should this rule be included in ESLint (instead of a plugin)?
This is a ES2016 feature, which can replace an older way of doing things. There should be a rule to force upgrading code; similar to how ESLint has no-var
, prefer-spread
, etc.
sindresorhus, LJNeon, platinumazure, saschanaz, ilyavolodin and 3 more
Metadata
Metadata
Assignees
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionfeatureThis change adds a new feature to ESLintThis change adds a new feature to ESLintruleRelates to ESLint's core rulesRelates to ESLint's core rules