Skip to content

regexp/no-dupe-characters-character-class

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

🔧 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 = /\\(\\)/;
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