`await-promise` error on mongoose project
See original GitHub issueHello, I’m trying lynt on a project that uses mongoose, and I got these errors when using await on a DocumentQuery
type from mongoose that behaves like a promise
const user = await UserModel.findById(id);
Is there any way to go around this error
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Error handling in async await - mongoose - Stack Overflow
You will get error in .catch method of async await. Suppose you have a function handleErrors(req, res, err) { return res.json({ success: ...
Read more >Node JS with Promise & Async await Mongoose ORM #23
Node JS & React Full Stack Training (Node JS and React JS )Full Playlist for node js crash ...
Read more >Mongoose v6.8.1: Promises
Mongoose queries are not promises. They have a .then() function for co and async/await as a convenience. If you need a fully-fledged promise,...
Read more >Returned promise from document's save() method not working ...
Now, I'm using the async/await to wait the the save() method, as per the docs the save() method returns a Promise. So:.
Read more >Handling those unhandled promise rejections with JS async ...
One of your await ed functions fails (i.e. rejects a promise); You get the error. Another possibility is that you know you need...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Changed my mind, lol
https://github.com/saadq/lynt/issues/18
Fixed by #16. There is already support for a
.lyntrc
file as noted here, but it is only for the same stuff that the CLI offers likeignore
and such. I don’t really want to add support for configuration of rules, because I think that vastly takes away from the point of this project.The one thing I may consider is adding a
disable
property to the settings which allows you to turn off any of the rules, but I think having something likeenable
wouldn’t make sense – the rules that you would want to enable should already exist inlynt
, and if they don’t an issue should be raised about it or there is already a good reason why it shouldn’t be in there.