Skip to content

if you not add comment line for state, it will show suggestion

Notifications You must be signed in to change notification settings

XiaoFeiHe1993/eslint-plugin-state

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-state

if you not add comments for react state variate or vue data variate, it will show error

如果你没有给 react state变量 或者 vue data变量 添加注释,那么 eslint 会提示一个错误,培养为变量写注释的好习惯

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-state:

$ npm install eslint-plugin-state --save-dev

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

Usage

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

{
    "plugins": [
        "state"
    ]
}

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

react state

{
    "rules": {
        "state/no-state-comment-line": "error"
    }
}

vue data

{
    "rules": {
        "state/no-data-comment-line": "error"
    }
}

About

if you not add comment line for state, it will show suggestion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published