Skip to content

Files

Latest commit

 

History

History
22 lines (16 loc) · 466 Bytes

no-escape-backspace.md

File metadata and controls

22 lines (16 loc) · 466 Bytes

Pattern: Use of escape backspace [\b]

Issue: -

Description

This rule reports [\b]. The word boundaries (\b) and the escape backspace ([\b]) are indistinguishable at a glance. This rule does not allow backspace ([\b]). Use Unicode escapes (\u0008) instead.

Examples

/* eslint regexp/no-escape-backspace: "error" */
/* ✓ GOOD */
var foo = /\b/;
var foo = /\u0008/;
var foo = /\cH/;
var foo = /\x08/;

/* ✗ BAD */
var foo = /[\b]/;