Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 1.1 KB

prefer-star-quantifier.md

File metadata and controls

47 lines (30 loc) · 1.1 KB
pageClass sidebarDepth title description since
rule-details
0
regexp/prefer-star-quantifier
enforce using `*` quantifier
v0.1.0

regexp/prefer-star-quantifier

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

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

enforce using * quantifier

📖 Rule Details

This rule is aimed at using * quantifier instead of {0,} in regular expressions.

/* eslint regexp/prefer-star-quantifier: "error" */

/* ✓ GOOD */
var foo = /a*/

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

🔧 Options

Nothing.

🚀 Version

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

🔍 Implementation