Skip to content

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.

Now loading...

🔧 Options

json
{
  "regexp/prefer-quantifier": ["error", {
    "allows": ["www", "\\d\\d"]
  }]
}
  • "allows" ... Array of allowed patterns.

{ "allows": ["www", "\\d\\d"] }

Now loading...

🚀 Version

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

🔍 Implementation