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

no-node-access to report where fireEvent/userEvent could be used #752

Open
zaicevas opened this issue Apr 12, 2023 · 3 comments
Open

no-node-access to report where fireEvent/userEvent could be used #752

zaicevas opened this issue Apr 12, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@zaicevas
Copy link
Contributor

What rule do you want to change?

no-node-access

Does this change cause the rule to produce more or fewer warnings?

More warnings

How will the change be implemented?

Not sure regarding the versioning (major/breaking change), but the idea behind this is that userEvent or fireEvent usage should be preferred over direct node access to call events, such as .focus(), .click(). We could have a whitelist of methods that would be reported by the rule.

Example code

screen.getByPlaceholderText('Search...').focus()

How does the current rule affect the code?

No error reported

How will the new rule affect the code?

Report an error

Anything else?

No response

Do you want to submit a pull request to change the rule?

No

@zaicevas zaicevas added enhancement New feature or request triage Pending to be triaged by a maintainer labels Apr 12, 2023
@Belco90
Copy link
Member

Belco90 commented May 4, 2023

Hi @zaicevas. It sounds like an excellent idea, actually. Not sure if fits better in this rule, or in a new one. Still, would be nice to report this. Are you up to work on it?

@Belco90 Belco90 removed the triage Pending to be triaged by a maintainer label May 4, 2023
@zaicevas
Copy link
Contributor Author

I'll try to evaluate the complexity and let you know :)

@zaicevas
Copy link
Contributor Author

zaicevas commented Sep 5, 2023

Apologies for late answer, but I don't have capacity right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants