# User Guide

# 💿 Installation

npm install --save-dev eslint eslint-plugin-regexp

Requirements

  • ESLint v6.0.0 and above
  • Node.js v12.x, v14.x and above

# 📖 Usage

Add regexp to the plugins section of your .eslintrc configuration file (you can omit the eslint-plugin- prefix) and either use one of the two configurations available (recommended or all) or configure the rules you want:

The plugin:regexp/recommended config enables a subset of the rules that should be most useful to most users. See lib/configs/recommended.ts (opens new window) for more details.

// .eslintrc.js
module.exports = {
    "plugins": [
        "regexp"
    ],
    "extends": [
         // add more generic rulesets here, such as:
         // 'eslint:recommended',
        "plugin:regexp/recommended"
    ]
}

# Advanced Configuration

Override/add specific rules configurations. See also: http://eslint.org/docs/user-guide/configuring (opens new window).

// .eslintrc.js
module.exports = {
    "plugins": [
        "regexp"
    ],
    "rules": {
        // Override/add rules settings here, such as:
        "regexp/rule-name": "error"
    }
}

# Using "plugin:regexp/all"

The plugin:regexp/all config enables all rules. It's meant for testing, not for production use because it changes with every minor and major version of the plugin. Use it at your own risk. See lib/configs/all.ts (opens new window) for more details.

See the rule list to get the rules that this plugin provides.

Some rules also support shared settings.

Last Updated: 5/18/2022, 12:31:32 PM