eslint-plugin-delorean
v0.0.1
Published
Choose Futures over Promises
Downloads
6
Maintainers
Readme
eslint-plugin-delorean
Choose Futures over Promises
Installation
You'll first need to install ESLint:
$ npm i eslint --save-devNext, install eslint-plugin-delorean:
$ npm install eslint-plugin-delorean --save-devNote: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-delorean globally.
Usage
Add delorean to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"delorean"
]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"delorean/yell-on-then": 2,
"delorean/yell-on-catch": 2
}
}Supported Rules
yell-on-then
Invalid Code:
x.then()Valid Code:
new Future((bad, good) => x.then(good).catch(bad))Options:
{ "library": "F" }- library - Optionally provide a library to validate against instead of "Future"
yell-on-catch
Invalid Code:
x.catch()Valid Code:
new Future((bad, good) => x.then(good).catch(bad))Options:
{ "library": "F" }- library - Optionally provide a library to validate against instead of "Future"
