-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
why does eslint require await for synchronous request and reply methods in VS code? #775
Comments
Seems to be, that typescript thinks that it is a promise and not a sync function. Can you provide a repo with that issue? |
I'll try to make a demo repo from our project |
LOL, that project has half of the npm registry as dependencies ;). Ok it is because FastifyReply has a .then-method with two parameters so eslint assumes it is a a Promise. It is an issue of eslint and not of Fastify. |
I wanted to keep the system in the state it is in for investigation :) But they will rightly object to me that everything that has the 'then' method is a Promise and what should I do in this situation? |
You mean with "they" your colleagues? Well sorry, but it is what it is. I dont know how we could fix it on our side to get that false positive fixed. It is an issue of eslint, as it is ducktyping it too wide. What you can do is to add a local patch and remove the then-method in reply.d.ts |
Not so. Such things are thennables. As covered in fastify/fastify#4246, it's out of our control. |
ok, I created an issue in eslint |
💬 Question here
here the code:
eslint error:
Your Environment
The text was updated successfully, but these errors were encountered: