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

Report '\08' and '\09' in no-octal-escape #12080

Closed
mdjermanovic opened this issue Aug 9, 2019 · 4 comments · Fixed by #12526, basics/vector#111, basics/vector#113, thinkwee/thinkwee.github.io#39 or alxtford/numconv#46
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 enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules

Comments

@mdjermanovic
Copy link
Member

mdjermanovic commented Aug 9, 2019

Tell us about your environment

  • ESLint Version: 6.1.0
  • Node Version: 10.16.0
  • npm Version: 6.9.0

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

default

Please show your full configuration:

Configuration
```js
module.exports = {
  parserOptions: {
    ecmaVersion: 2015,
  },
};

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 no-octal-escape: "error"*/

"\08"
"\09"
eslint index.js

What did you expect to happen?

2 errors

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

No errors

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

Yes, I'll be glad to do it. (#12079 should be merged first as this would collide)

Engines/parsers are already reporting these as octal escapes in strict mode:

"use strict";
"\08"
  • Chrome: Octal escape sequences are not allowed in strict mode.
  • Firefox: "0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead
  • Espree: Octal literal in strict mode

Per the spec. 08 is not a valid escape sequence but it seems that it can be interpreted like 0 as a LegacyOctalEscapeSequence followed by a character 8.

LegacyOctalEscapeSequence::

OctalDigit[lookahead ∉ OctalDigit]

So I guess to be technically correct the rule should report \0?

@mdjermanovic mdjermanovic added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Aug 9, 2019
@mdjermanovic mdjermanovic added enhancement This change enhances an existing feature of ESLint 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 Aug 23, 2019
@eslint-deprecated eslint-deprecated bot added the auto closed The bot closed this issue label Sep 23, 2019
@eslint-deprecated
Copy link

Unfortunately, it looks like there wasn't enough interest from the team
or community to implement this change. While we wish we'd be able to
accommodate everyone's requests, we do need to prioritize. We've found
that issues failing to reach accepted status after 21 days tend to
never be accepted, and as such, we close those issues.
This doesn't mean the idea isn't interesting or useful, just that it's
not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

@mdjermanovic
Copy link
Member Author

Reopening because it's probably a false negative.

@mdjermanovic mdjermanovic reopened this Sep 23, 2019
@mdjermanovic mdjermanovic removed the auto closed The bot closed this issue label Sep 23, 2019
@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 Sep 29, 2019
@kaicataldo
Copy link
Member

Marking this as accepted since it's a bug report with three 👍s

@kaicataldo kaicataldo added Hacktoberfest Recommended issue for those participating in Hacktoberfest https://hacktoberfest.digitalocean.com/ help wanted The team would welcome a contribution from the community for this issue labels Oct 1, 2019
@mdjermanovic
Copy link
Member Author

Looks like no one is working on this, so I'll take it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.