1.0.5 • Published 7 years ago
eslint-plugin-agree v1.0.5
eslint-plugin-agree
agree自定义eslint规则
Installation
You'll first need to install ESLint:
$ npm i eslint --save-devNext, install eslint-plugin-agree:
$ npm install eslint-plugin-agree --save-devNote: 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();
}