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

prefer-numeric-literals overlooks template literal #13045

Closed
yeonjuan opened this issue Mar 14, 2020 · 2 comments · Fixed by #13046
Closed

prefer-numeric-literals overlooks template literal #13045

yeonjuan opened this issue Mar 14, 2020 · 2 comments · Fixed by #13046
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

Tell us about your environment

  • ESLint Version: v7.0.0-alpha.2
  • Node Version: v11.15.0
  • npm Version: 6.7.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.

/*eslint prefer-numeric-literals: "error"*/

parseInt(`111110111`, 2) === 503;

What did you expect to happen?

1 error.

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

No error

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

Yes.

@yeonjuan yeonjuan added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon evaluating The team will evaluate this issue to decide whether it 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 Mar 14, 2020
@mdjermanovic
Copy link
Member

I agree it's reasonable to treat "static" template literals as string literals in this rule 👍

@kaicataldo kaicataldo added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Mar 17, 2020
@kaicataldo
Copy link
Member

I agree that this is a missing case 👍

kaicataldo pushed a commit that referenced this issue Mar 20, 2020
…#13046)

* Fix: check template literal in prefer-numeric-literals (fixes #13045)

* remove useless parserOptions
anikethsaha pushed a commit to anikethsaha/eslint that referenced this issue Mar 23, 2020
…13045) (eslint#13046)

* Fix: check template literal in prefer-numeric-literals (fixes eslint#13045)

* remove useless parserOptions
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Sep 18, 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 Sep 18, 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

Successfully merging a pull request may close this issue.

3 participants