sort alternatives if order doesn't matter
- 🔧 The
--fixoption on the command line (opens new window) can automatically fix some of the problems reported by this rule.
# 📖 Rule Details
This rule will sort alternatives to improve readability and maintainability.
The primary target of this rule are lists of words and/or numbers. These lists are somewhat common and sorting them makes it easy for readers to check whether a particular word or number is included.
This rule will only sort alternatives if reordering the alternatives doesn't affect the pattern.
# 🔧 Options
# 🚀 Version
This rule was introduced in eslint-plugin-regexp v0.12.0