Skip to content

regexp/hexadecimal-escape

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

enforce consistent usage of hexadecimal escape

📖 Rule Details

Characters that can use hexadecimal escape can use both hexadecimal escape and unicode escape.

This rule aims to enforce the consistent use of hexadecimal escapes.

Now loading...

🔧 Options

json5
{
  "regexp/hexadecimal-escape": [
    "error",
    "always", // or "never"
  ]
}
  • "always" ... Unicode escape characters that can use hexadecimal escape must always use hexadecimal escape. This is default.
  • "never" ... Disallows the use of hexadecimal escapes on all characters.

"never"

Now loading...

🚀 Version

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

🔍 Implementation