Description
Have you read the Troubleshooting section?
Yes
Plugin version
v7.5.1
ESLint version
n/a
Node.js version
n/a
Bug description
As discussed in #1026, the focus()
method of an HTML node shouldn't be reported, as it's recommended by Testing Library.
Steps to reproduce
import { screen, fireEvent } from '@testing-library/react'
test('should not report focus method', () => {
screen.getByText('click me').focus();
// this shouldn't be reported ---^
fireEvent.keyDown(document.activeElement || document.body);
})
Error output/screenshots
No response
ESLint configuration
N/A
Rule(s) affected
no-node-access
Anything else?
Originated in #1026
Do you want to submit a pull request to fix this bug?
No