Skip to content
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

chore: delete custom rule to await user event #94

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { fireEvent, userEvent } from "@testing-library/react-native";

// This should trigger an error breaking eslint-testing-library rule:
// testing-library/no-await-sync-events
// @bam.tech/await-user-event
// @typescript-eslint/no-floating-promises

it("a test", async () => {
await fireEvent();
Expand Down
11 changes: 4 additions & 7 deletions packages/eslint-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,12 @@ This plugin exports some custom rules that you can optionally use in your projec

<!-- begin auto-generated rules list -->

💼 Configurations enabled in.\
🧪 Set in the `tests` configuration.\
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).

| Name | Description | 💼 | 🔧 |
| :------------------------------------------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------- | :-- | :-- |
| [await-user-event](https://github.com/bamlab/react-native-project-config/blob/main/packages/eslint-plugin/docs/rules/await-user-event.md) | Enforces awaiting userEvent calls | 🧪 | 🔧 |
| [prefer-user-event](https://github.com/bamlab/react-native-project-config/blob/main/packages/eslint-plugin/docs/rules/prefer-user-event.md) | Enforces usage of userEvent over fireEvent in tests. | | 🔧 |
| [require-named-effect](https://github.com/bamlab/react-native-project-config/blob/main/packages/eslint-plugin/docs/rules/require-named-effect.md) | Enforces the use of named functions inside a useEffect | | |
| Name | Description | 🔧 |
| :------------------------------------------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------- | :-- |
| [prefer-user-event](https://github.com/bamlab/react-native-project-config/blob/main/packages/eslint-plugin/docs/rules/prefer-user-event.md) | Enforces usage of userEvent over fireEvent in tests. | 🔧 |
| [require-named-effect](https://github.com/bamlab/react-native-project-config/blob/main/packages/eslint-plugin/docs/rules/require-named-effect.md) | Enforces the use of named functions inside a useEffect | |

<!-- end auto-generated rules list -->

Expand Down
23 changes: 0 additions & 23 deletions packages/eslint-plugin/docs/rules/await-user-event.md

This file was deleted.

1 change: 0 additions & 1 deletion packages/eslint-plugin/lib/configs/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,5 @@ module.exports = defineConfig({
"testing-library/prefer-presence-queries": "error",
"testing-library/no-wait-for-side-effects": "error",
"testing-library/prefer-screen-queries": "error",
"@bam.tech/await-user-event": "error",
},
});
49 changes: 0 additions & 49 deletions packages/eslint-plugin/lib/rules/await-user-event.js

This file was deleted.