Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.27 KB

no-escape-backspace.md

File metadata and controls

51 lines (34 loc) · 1.27 KB
pageClass sidebarDepth title description since
rule-details
0
regexp/no-escape-backspace
disallow escape backspace (`[\b]`)
v0.1.0

regexp/no-escape-backspace

💼 This rule is enabled in the ✅ plugin:regexp/recommended config.

💡 This rule is manually fixable by editor suggestions.

disallow escape backspace ([\b])

📖 Rule Details

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]/;

🔧 Options

Nothing.

🚀 Version

This rule was introduced in eslint-plugin-regexp v0.1.0

🔍 Implementation