# regexp/sort-character-class-elements

enforces elements order in character class

# 📖 Rule Details

This rule checks elements of character classes are sorted.

Now loading...

# 🔧 Options

{
  "regexp/sort-character-class-elements": ["error", {
    "order": [
      "\\s", // \s or \S
      "\\w", // \w or \W
      "\\d", // \d or \D
      "\\p", // \p{...} or \P{...}
      "*", // Others (A character or range of characters or an element you did not specify.)
    ]
  }]
}
  • "order" ... An array of your preferred order. The default is ["\\s", "\\w", "\\d", "\\p", "*",].

# 🚀 Version

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

# 🔍 Implementation

Last Updated: 6/25/2022, 12:32:38 PM