Skip to content

regexp/no-obscure-range

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

disallow obscure character ranges

📖 Rule Details

The character range operator (the - inside character classes) can easily be misused (mostly unintentionally) to construct non-obvious character class. This rule will disallow all non-obvious uses of the character range operator.

Now loading...

🔧 Options

json5
{
  "regexp/no-obscure-range": ["error",
    {
      "allowed": "alphanumeric" // or "all" or [...]
    }
  ]
}

This option can be used to override the allowedCharacterRanges setting.

It allows all values that the allowedCharacterRanges setting allows.

"allowed": "alphanumeric"

Now loading...

"allowed": "all"

Now loading...

"allowed": [ "alphanumeric", "😀-😏" ]

Now loading...

🚀 Version

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

🔍 Implementation

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy