Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 1.03 KB

prefer-quantifier.md

File metadata and controls

45 lines (29 loc) · 1.03 KB
pageClass sidebarDepth title description since
rule-details
0
regexp/prefer-quantifier
enforce using quantifier
v0.2.0

regexp/prefer-quantifier

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

enforce using quantifier

📖 Rule Details

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/;

🔧 Options

Nothing.

🚀 Version

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

🔍 Implementation