1. eslint-plugin-class-property
Enforces semicolon after class properties
eslint-plugin-class-property
Package: eslint-plugin-class-property
Created by: marudor
Last modified: Thu, 08 Jun 2023 21:37:52 GMT
Version: 1.1.0
License: MIT
Downloads: 21,530
Repository: https://github.com/marudor/eslint-plugin-class-property

Install

npm install eslint-plugin-class-property
yarn add eslint-plugin-class-property

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-dev

Next, install eslint-plugin-class-property:

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

Note: 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'
}

Dependencies

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code