2.0.0 • Published 2 years ago

eslint-plugin-class-extends v2.0.0

Weekly downloads
544
License
MIT
Repository
github
Last release
2 years ago

eslint-plugin-class-extends

ESLint rule to prevent extending classes.

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-class-extends:

$ npm install eslint-plugin-class-extends --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-class-extends globally.

Usage

Add class-extends to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["class-extends"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "class-extends/react-extends-only": 2
  }
}

Recommended

This plugin exports a recommended configuration that includes the one rule to prevent extending classes other than [React.]Component and [React.]PureComponent.

To enable this configuration use the extends property in your .eslintrc config file:

{
  "extends": [
    "eslint:recommended",
    "plugin:react/recommended",
    "plugin:class-extends/recommended"
  ]
}

Supported Rules

2.0.0

2 years ago

1.0.0

4 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.1

7 years ago