Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 1.23 KB

no-useless-two-nums-quantifier.md

File metadata and controls

52 lines (35 loc) · 1.23 KB
pageClass sidebarDepth title description since
rule-details
0
regexp/no-useless-two-nums-quantifier
disallow unnecessary `{n,m}` quantifier
v0.1.0

regexp/no-useless-two-nums-quantifier

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

🔧 This rule is automatically fixable by the --fix CLI option.

disallow unnecessary {n,m} quantifier

📖 Rule Details

This rule reports unnecessary {n,m} quantifiers.

/* eslint regexp/no-useless-two-nums-quantifier: "error" */

/* ✓ GOOD */
var foo = /a{0,1}/;
var foo = /a{1,5}/;
var foo = /a{1,}/;
var foo = /a{2}/;

/* ✗ BAD */
var foo = /a{0,0}/;
var foo = /a{1,1}/;
var foo = /a{2,2}/;

🔧 Options

Nothing.

🚀 Version

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

🔍 Implementation