2 title: no-nonoctal-decimal-escape
8 - https://tc39.es/ecma262/#prod-annexB-NonOctalDecimalEscapeSequence
15 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:
22 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.
24 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.
26 Regardless of your targeted environment, these escape sequences shouldn't be used when writing new code.
30 This rule disallows `\8` and `\9` escape sequences in string literals.
32 Examples of **incorrect** code for this rule:
37 /*eslint no-nonoctal-decimal-escape: "error"*/
45 var bar = "December 1\9";
47 var baz = "Don't use \8 and \9 escapes.";
54 Examples of **correct** code for this rule:
59 /*eslint no-nonoctal-decimal-escape: "error"*/
67 var bar = "December 19";
69 var baz = "Don't use \\8 and \\9 escapes.";
71 var quux = "\0\u0038";