pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
regexp/prefer-quantifier |
enforce using quantifier |
v0.2.0 |
🔧 This rule is automatically fixable by the --fix
CLI option.
enforce using quantifier
This rule is aimed to use quantifiers instead of consecutive characters in regular expressions.
/* eslint regexp/prefer-quantifier: "error" */
/* ✓ GOOD */
var foo = /\d{4}-\d{2}-\d{2}/;
/* ✗ BAD */
var foo = /\d\d\d\d-\d\d-\d\d/;
Nothing.
This rule was introduced in eslint-plugin-regexp v0.2.0