Skip to content

New rule for preventing flushing #1011

@Belco90

Description

@Belco90
Member

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

Activity

added
new ruleNew rule to be included in the plugin
triagePending to be triaged by a maintainer
on May 19, 2025
self-assigned this
on May 19, 2025
removed
triagePending to be triaged by a maintainer
on May 19, 2025
added theissue type on May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

new ruleNew rule to be included in the plugin

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Belco90

      Issue actions

        New rule for preventing flushing · Issue #1011 · testing-library/eslint-plugin-testing-library