Skip to content

tx44/eslint-plugin-class-methods-use-this-regexp

Repository files navigation

eslint-plugin-class-methods-use-this-regexp

travis coveralls greenkeeper npm

An enhanced version of the ESLint class-methods-use-this rule with RegExp exceptMethods option.

Installation

Install ESLint and eslint-plugin-class-methods-use-this-regexp:

$ npm install --save-dev eslint eslint-plugin-class-methods-use-this-regexp

Usage

Add class-methods-use-this-regexp to the plugins section of your .eslintrc configuration file, and configure the rule under the rules section. Don't forget to disable the core rule class-methods-use-this:

{
  "plugins": [
    "class-methods-use-this-regexp"
  ],
  "rules": {
    "class-methods-use-this": 0,
    "class-methods-use-this-regexp/class-methods-use-this": [2, {"exceptMethods": ["render"]}]
  }
}

Alternatively you may use the plugin's recommended configuration, which applies the above configuration:

{
  "extends": ["plugin:class-methods-use-this-regexp/recommended"]
}

About

An enhanced version of the ESLint class-methods-use-this rule with RegExp exceptMethods option

Resources

Stars

Watchers

Forks

Packages

No packages published