pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
regexp/no-control-character |
disallow control characters |
v1.2.0 |
💡 This rule is manually fixable by editor suggestions.
disallow control characters
This rule reports control characters.
This rule is inspired by the no-control-regex rule. The positions of reports are improved over the core rule and suggestions are provided in some cases.
/* eslint regexp/no-control-character: "error" */
/* ✓ GOOD */
var foo = /\n/;
var foo = RegExp("\n");
/* ✗ BAD */
var foo = /\x1f/;
var foo = /\x0a/;
var foo = RegExp('\x0a');
Nothing.
This rule was introduced in eslint-plugin-regexp v1.2.0