pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
regexp/prefer-question-quantifier |
enforce using `?` quantifier |
v0.1.0 |
💼 This rule is enabled in the ✅ plugin:regexp/recommended
config.
🔧 This rule is automatically fixable by the --fix
CLI option.
enforce using
?
quantifier
This rule is aimed at using ?
quantifier instead of {0,1}
in regular expressions.
/* eslint regexp/prefer-question-quantifier: "error" */
/* ✓ GOOD */
var foo = /a?/;
/* ✗ BAD */
var foo = /a{0,1}/;
Nothing.
This rule was introduced in eslint-plugin-regexp v0.1.0