eslint-plugin-class-property
DEPRECATED
Please use babel-plugin-eslint with the babel/semi rule!
Installation
You'll first need to install ESLint:
$ npm i eslint --save-devNext, install eslint-plugin-class-property:
$ npm install eslint-plugin-class-property --save-devNote: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-class-property globally.
Usage
Add class-property to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"class-property"
]
}Supported Rules
class-property/class-property-semicolon
This rule enforces consistent use of semicolons for class properties.
Options
This rule has a single string optio:
"always"(default) requires semicolons at the end of a class property"never"disallows semicolons as the end of a class property
always
Examples of incorrect code for this rule with the default "always" option:
/*eslint class-property/class-property-semicolon: ["error", "always"]*/
class MyClass {
classProperty = 'foo'
}Examples of correct code for this rule with the default "always" option:
/*eslint class-property/class-property-semicolon: ["error", "always"]*/
class MyClass {
classProperty = 'foo';
}never
Examples of incorrect code for this rule with the "never" option:
/*eslint class-property/class-property-semicolon: ["error", "never"]*/
class MyClass {
classProperty = 'foo';
}Examples of correct code for this rule with the "never" option:
/*eslint class-property/class-property-semicolon: ["error", "never"]*/
class MyClass {
classProperty = 'foo'
}