Comments (6)
I don't think I agree with this, because then the rule becomes less helpful to many people. Is there a specific case where it's handling bluebird (or other style) promises incorrectly?
from eslint-plugin-promise.
The problem is not incorrect handling but rather more than the standard.
There is a big benefit (advantage) to stick to the standard in order to avoid "locking" to a specific library. Otherwise, when you want to switch to different promises library (common situation) it becomes very problematic.
I understand the argument that the rule becomes less helpful to many people; for sure if you are not considering long-term development. So, the rule can be provided as default with "off" or "warn".
from eslint-plugin-promise.
@tamirmen, @lidortal I think I misunderstood the proposal. Your suggestion here is a rule that might look like this:
"promise/spec-only": "error"
Which would effectively ban you from doing any of the non-spec stuff like p.done()
or Promise.try
?
I think I'm okay with this idea, could you put together a proposal of what exactly should result in an error?
from eslint-plugin-promise.
Yes, this is the idea.
IMO when someone uses non-spec stuff, an error should be returned with the message - follow the standard.
For example:
prom.then() - wouldn't return an error.
prom.spread() - would return an error.
from eslint-plugin-promise.
@xjamundx - is there any progress on this topic?
from eslint-plugin-promise.
#72 is related to this issue and has some useful test cases and implementation suggestions that would help in resolving this feature request.
Help is wanted with a PR, but I will try to open a PR in the next week or so. Please communicate if you would like to contribute this feature!
from eslint-plugin-promise.
Related Issues (20)
- > @xjamundx what can we do to help to get this merged? HOT 1
- > @xjamundx what can we do to help to get this merged? HOT 1
- > > @xjamundx what can we do to help to get this merged? HOT 1
- No tag for v5.2.0 HOT 5
- prefer-await-to-then doesn't enforce .then/.catch/.finally HOT 2
- Invitation to move to official `eslint-community` org
- Consider automatic releases HOT 1
- Add support for Promise.allSettled() and Promise.any() HOT 1
- `no-multiple-resolved` wrongly reports `reject` in try/catch block HOT 6
- .github/workflows/CI.yml
- `promise/prefer-await-to-then` ignore constructor scope HOT 1
- Rule to require that Promise executor function calls resolve
- `no-multiple-resolved` wrongly reports `reject` in try/catch block
- False positive of `isInsideCallback` for functions with first arg named `err`/`error`
- does it support typescript?
- New Rule: Prefer `Promise.resolve(foo)` to `new Promise((resolve) => resolve(foo))`
- Support ESLint 9 and Flat config HOT 13
- apromise/catch-or-return will cause many empty callback of match
- `promise/always-return` should not be reported when process exits HOT 1
- `always-return`: enable `ignoreLastCallback` by default
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-promise.