Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

noFloatingPromises, typescript-eslint/no-floating-promises #4168

Open
jpike88 opened this issue Jan 23, 2023 · 6 comments
Open

noFloatingPromises, typescript-eslint/no-floating-promises #4168

jpike88 opened this issue Jan 23, 2023 · 6 comments
Labels
A-Linter Area: linter task A task, an action that needs to be performed

Comments

@jpike88
Copy link

jpike88 commented Jan 23, 2023

Description

https://typescript-eslint.io/rules/no-floating-promises

important would be have the ignoreVoid enabled, as adding void before a Promise can explicitly define that Promise as one that is not designed to be awaited and blocking the function's execution.

@jpike88 jpike88 added the task A task, an action that needs to be performed label Jan 23, 2023
@jpike88
Copy link
Author

jpike88 commented Jan 23, 2023

this rule is critical for our projects, it prevents some very nasty situations from occurring, as floating promises can cause sync issues with our data model.

@jpike88 jpike88 changed the title noFloatingPromises, no-floating-promises noFloatingPromises, typescript-eslint/no-floating-promises Jan 24, 2023
@Conaclos Conaclos added the A-Linter Area: linter label Feb 22, 2023
@mphill
Copy link

mphill commented Mar 2, 2023

This would definitely help catch weird runtime errors. Looking forward to it’s support!

@denbezrukov
Copy link
Contributor

denbezrukov commented Mar 2, 2023

Unfortunately the rule implementation requires information about types.
I'm afraid that we can't implement it fully without a compiler.

@jpike88
Copy link
Author

jpike88 commented Mar 3, 2023

I understand. This rule is actually so critical that I think I'm going to bring back eslint into our CI tests just for that rule alone.

@jpike88
Copy link
Author

jpike88 commented Mar 27, 2023

I actually think that this would be the answer, not something a linter should handle as it fundamentally can change the behaviour or the code. Don't really know if it's a linter's place to be reaching that far.

microsoft/TypeScript#13376

Can close this if you like

@public
Copy link

public commented Jun 14, 2023

This rule is very important for us too and it is also 2-3x slower than any other rule we have enabled in eslint. I am happy to use a mix of eslint and rome as needed but a Rust implementation of this rule seems like it would have a significant impact to our lint times.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter task A task, an action that needs to be performed
Projects
None yet
Development

No branches or pull requests

5 participants