testing-library / testing-library/eslint-plugin-testing-library
New rule for preventing flushing
Open
@Belco90 is already working on this.
Since May 19, 2025.
new rule
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 168
- Avg merge
- 15h 44m
- Merged PRs (30d)
- 14
Description
Name for new rule
no-flush
Description of the new rule
The goal of this rule would be preventing any flush attempt, like await act(() => Promise.resolve()).
I can't think of any other flush mechanism in Testing Library for now, so we can start reporting the previous scenario and add more in the future if needed.
Testing Library feature
Appearance and Disappearance. Usually, dealing with async behaviors is a matter of waiting for something in the UI to appear/disappear.
Testing Library framework(s)
All of them.
What category of rule is this?
Warns about a potential error
Optional: other category of rule
No response
Code examples
await act(() => Promise.resolve())
Anything else?
No response
Do you want to submit a pull request to make the new rule?
Yes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.