-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
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
?