2 title: no-nonoctal-decimal-escape
7 - https://tc39.es/ecma262/#prod-annexB-NonOctalDecimalEscapeSequence
14 Although not being specified in the language until ECMAScript 2021, `\8` and `\9` escape sequences in string literals were allowed in most JavaScript engines, and treated as "useless" escapes:
21 Since ECMAScript 2021, these escape sequences are specified as [non-octal decimal escape sequences](https://tc39.es/ecma262/#prod-annexB-NonOctalDecimalEscapeSequence), retaining the same behavior.
23 Nevertheless, the ECMAScript specification treats `\8` and `\9` in string literals as a legacy feature. This syntax is optional if the ECMAScript host is not a web browser. Browsers still have to support it, but only in non-strict mode.
25 Regardless of your targeted environment, these escape sequences shouldn't be used when writing new code.
29 This rule disallows `\8` and `\9` escape sequences in string literals.
31 Examples of **incorrect** code for this rule:
36 /*eslint no-nonoctal-decimal-escape: "error"*/
44 var bar = "December 1\9";
46 var baz = "Don't use \8 and \9 escapes.";
53 Examples of **correct** code for this rule:
58 /*eslint no-nonoctal-decimal-escape: "error"*/
66 var bar = "December 19";
68 var baz = "Don't use \\8 and \\9 escapes.";
70 var quux = "\0\u0038";