regexp/prefer-result-array-groups
🔧 This rule is automatically fixable by the --fix CLI option.
enforce using result array
groups
📖 Rule Details
This rule reports and fixes regexp result arrays where named capturing groups are accessed by index instead of using groups.
🔧 Options
json
{
"regexp/prefer-result-array-groups": ["error", {
"strictTypes": true
}]
}strictTypes... Iftrue, strictly check the type of object to determine if the string instance was used inmatch()andmatchAll(). Default istrue.
This option is always on when using TypeScript.
👫 Related rules
🚀 Version
This rule was introduced in eslint-plugin-regexp v1.4.0