pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
regexp/no-escape-backspace |
disallow escape backspace (`[\b]`) |
v0.1.0 |
💼 This rule is enabled in the ✅ plugin:regexp/recommended
config.
💡 This rule is manually fixable by editor suggestions.
disallow escape backspace (
[\b]
)
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.
/* eslint regexp/no-escape-backspace: "error" */
/* ✓ GOOD */
var foo = /\b/;
var foo = /\u0008/;
var foo = /\cH/;
var foo = /\x08/;
/* ✗ BAD */
var foo = /[\b]/;
Nothing.
This rule was introduced in eslint-plugin-regexp v0.1.0