# regexp/prefer-named-replacement

enforce using named replacement

# 📖 Rule Details

This rule reports and fixes $n parameter in replacement string that do not use the name of their referenced capturing group.

Now loading...

# 🔧 Options

{
  "regexp/prefer-named-replacement": ["error", {
      "strictTypes": true
  }]
}
  • strictTypes ... If true, strictly check the type of object to determine if the string instance was used in replace() and replaceAll(). Default is true.
    This option is always on when using TypeScript.

# 🚀 Version

This rule was introduced in eslint-plugin-regexp v1.4.0

# 🔍 Implementation

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