eslint-plugin-agree

1.0.5 • Public • Published

eslint-plugin-agree

agree自定义eslint规则

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-agree:

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

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

Usage

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

{
    "plugins": [
        "agree"
    ]
}

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

{
    "rules": {
        "agree/rule-name": 2
    }
}

Rules

agree/async-must-await

Invalid code: (since getResultAsync is called without await)

async function getResultAsync() {};
async function submit() {
  getResultAsync();
}

Valid code:

async function getResultAsync() {};
async function submit() {
  await getResultAsync();
}

Package Sidebar

Install

npm i eslint-plugin-agree

Weekly Downloads

0

Version

1.0.5

License

ISC

Unpacked Size

6.64 kB

Total Files

7

Last publish

Collaborators

  • agree