---
source: crates/oxc_linter/src/tester.rs
expression: no_useless_escape
---
  ⚠ eslint(no-useless-escape): Unnecessary escape character '#'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /\#/;
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character ';'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /\;/;
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '\''
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = "\'";
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '#'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = "\#/";
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'a'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = "\a"
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'B'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = "\B";
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '@'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = "\@";
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'a'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = "foo \a bar";
   ·                ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '"'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = '\"';
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '#'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = '\#';
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '$'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = '\$';
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'p'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = '\p';
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'p'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = '\p\a\@';
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'a'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = '\p\a\@';
   ·              ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '@'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = '\p\a\@';
   ·                ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'd'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ <foo attr={"\d"}/>
   ·             ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '`'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = '\`';
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '"'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = `\"`;
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '\''
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = `\'`;
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '#'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = `\#`;
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '`'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = '\`foo\`';
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '`'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = '\`foo\`';
   ·                 ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '"'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = `\"${foo}\"`;
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '"'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = `\"${foo}\"`;
   ·                    ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '\''
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = `\'${foo}\'`;
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '\''
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = `\'${foo}\'`;
   ·                    ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '#'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = `\#${foo}`;
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character ' '
   ╭─[no_useless_escape.tsx:1:1]
 1 │ let foo = '\ ';
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character ' '
   ╭─[no_useless_escape.tsx:1:1]
 1 │ let foo = /\ /;
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '$'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = `\$\{{${foo}`;
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '{'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = `\$\{{${foo}`;
   ·              ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '$'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = `\$a${foo}`;
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '{'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = `a\{{${foo}`;
   ·             ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '-'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /[ab\-]/
   ·               ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '-'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /[\-ab]/
   ·             ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '?'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /[ab\?]/
   ·               ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '.'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /[ab\.]/
   ·               ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '|'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /[a\|b]/
   ·              ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '-'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /\-/
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '-'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /[\-]/
   ·             ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '$'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /[ab\$]/
   ·               ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '('
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /[\(paren]/
   ·             ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '['
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /[\[]/
   ·             ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '/'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /[\/]/
   ·             ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'B'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /[\B]/
   ·             ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '-'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /[a][\-b]/
   ·                ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '-'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /\-[]/
   ·            ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '^'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /[a\^]/
   ·              ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'e'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ `multiline template
 2 │ literal with useless \escape`
   ·                      ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'e'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ `multiline template
 2 │ literal with useless \escape`
   ·                      ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'e'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ `template literal with line continuation \
 2 │ and useless \escape`
   ·             ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'e'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ `template literal with line continuation \
 2 │ and useless \escape`
   ·             ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'a'
   ╭─[no_useless_escape.tsx:3:1]
 3 │ 
 4 │ \and useless escape`
   · ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'a'
   ╭─[no_useless_escape.tsx:3:1]
 3 │ \
 4 │ \and useless escape`
   · ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character 'a'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ `\a```
   ·  ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '（'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /\（([^\）\（]+)\）$|\(([^\)\)]+)\)$/;
   ·            ───
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '）'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /\（([^\）\（]+)\）$|\(([^\)\)]+)\)$/;
   ·                  ───
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '（'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /\（([^\）\（]+)\）$|\(([^\)\)]+)\)$/;
   ·                     ───
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '）'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /\（([^\）\（]+)\）$|\(([^\)\)]+)\)$/;
   ·                           ───
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character ')'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /\（([^\）\（]+)\）$|\(([^\)\)]+)\)$/;
   ·                                     ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character ')'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var foo = /\（([^\）\（]+)\）$|\(([^\)\)]+)\)$/;
   ·                                       ──
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '\u{85}'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var stringLiteralWithNextLine = "line 1\line 2";
   ·                                        ─
   ╰────

  ⚠ eslint(no-useless-escape): Unnecessary escape character '\u{85}'
   ╭─[no_useless_escape.tsx:1:1]
 1 │ var stringLiteralWithNextLine = `line 1\line 2`;
   ·                                        ─
   ╰────


