Skip to content

regexp/no-dupe-characters-character-class ​

💼 This rule is enabled in the following configs: 🟢 flat/recommended, 🔵 recommended.

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

disallow duplicate characters in the RegExp character class

Because multiple same character classes in regular expressions only one is useful, they might be typing mistakes.

js
var foo = /\\(\\)/;

📖 Rule Details ​

This rule disallows duplicate characters in the RegExp character class.

Now loading...

🔧 Options ​

Nothing.

🚀 Version ​

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

🔍 Implementation ​