some rules for proposal class. eg: class property.
This package is migrated to
eslint-plugin-proposal
, please useeslint-plugin-proposal
instead ofeslint-plugin-proposal-class
.
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-proposal-class
:
$ npm install eslint-plugin-proposal-class --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-proposal-class
globally.
Add proposal-class
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"proposal-class"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"proposal-class/class-property-space-infix-ops": "error"
}
}
- proposal-class/class-property-space-infix-ops require or disallow spacing between operator '=' in class property.
- proposal-class/class-property-semi require or disallow semicolons instead of ASI in class property.
- proposal-class/class-property-no-extra-semi disallow unnecessary semicolons in class property.
- proposal-class/class-property-no-semi-spacing disallow spacing before semicolons in class property.
- proposal-class/no-dupe-class-property disallow duplicate class property.
This plugin exports a recommended configuration.
To enable this configuration use the extends property in your .eslintrc config file:
{
"extends": [
"plugin:proposal-class/recommended"
]
}
The rules enabled in this configuration are: