Skip to content

Files

Latest commit

 

History

History
23 lines (17 loc) · 455 Bytes

control-character-escape.md

File metadata and controls

23 lines (17 loc) · 455 Bytes

Pattern: Unescaped or inconsistent control character

Issue: -

Description

This rule reports control characters that were not escaped using a control escape (\0, \t, \n, \v, \f, \r).

Examples

/* eslint regexp/control-character-escape: "error" */
/* ✓ GOOD */
var foo = /[\n\r]/;
var foo = /\t/;
var foo = RegExp("\t+\n");

/* ✗ BAD */
var foo = /	/;
var foo = /\u0009/;
var foo = /\u{a}/u;
var foo = RegExp("\\u000a");