Skip to content

Latest commit

 

History

History
56 lines (36 loc) · 1.3 KB

no-control-character.md

File metadata and controls

56 lines (36 loc) · 1.3 KB
pageClass sidebarDepth title description since
rule-details
0
regexp/no-control-character
disallow control characters
v1.2.0

regexp/no-control-character

💡 This rule is manually fixable by editor suggestions.

disallow control characters

📖 Rule Details

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');

🔧 Options

Nothing.

📚 Further reading

🚀 Version

This rule was introduced in eslint-plugin-regexp v1.2.0

🔍 Implementation