pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
regexp/no-useless-two-nums-quantifier |
disallow unnecessary `{n,m}` quantifier |
v0.1.0 |
💼 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
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}/;
Nothing.
This rule was introduced in eslint-plugin-regexp v0.1.0