eslint-plugin-promise icon indicating copy to clipboard operation
eslint-plugin-promise copied to clipboard

Enforce best practices for JavaScript promises

Results 82 eslint-plugin-promise issues
Sort by recently updated
recently updated
newest added
trafficstars

Putting callback code inside of async functions like this can lead to a lot of trouble: ```js async function bigProbs() { doSomething(function(err) { if (err) throw err; // won't be...

enhancement
help wanted

Forgetting to put an await before calling an async function can have very bad outcomes and is quite hard to notice TSLint has a rule named no-floating-promises -https://palantir.github.io/tslint/rules/no-floating-promises/ Can you...

enhancement
help wanted

### Description For consistency, I feel that the prefer-await-to-then rule should also flag promise.catch and promise.finally so we can enforce async/await everywhere if desired. ### Steps to Reproduce 1. Run...

enhancement

### Description The `no-callback-in-promise` rule only checks for [CallExpressions](https://github.com/xjamundx/eslint-plugin-promise/blob/5b935bdd3c3760a2e58eea9b89c86b6d3243e321/rules/lib/is-callback.js#L6). It does not check if a callback is passed to a third-party like `setTimeout(callback)`. I think any time a callback is...

bug :bug:

### Description Promisification utilities like `Bluebird.fromCallback` are useful to interface with Node-style APIs. Unfortunately, `no-callback-in-promise` isn't smart enough to realize that these are legitimate uses for calling a callback inside...

enhancement

Is there a way to enforce that async functions do not return a promise? For example, I'd like to enforce we don't have code like this: ``` async function publishUser(user)...

enhancement

Hello, It would be great if promises in this form triggered a warning: ```js function foo() { return bar() .then(...) .catch((err) => { console.error(err); }); } ``` Rather than trying...

enhancement
help wanted

### Description When using Bluebird, there are cases that deviate from the standard usage of promise functions. One that I found is Bluebird's `.catch` can receive 2 arguments. See http://bluebirdjs.com/docs/api/catch.html#filtered-catch...

enhancement

### Description https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/prefer-await-to-callbacks.md

help wanted
good first issue
documentation :book:

This innocently looking assignment: ``` const FAIL = Promise.reject(); ``` causes UnhandledPromiseRejectionWarning if FAIL is not used...

enhancement
help wanted
feedback-sought