Open
Description
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