Skip to content

no-node-access rule output false-positive warning after 7.5.0 release #1024

Closed
@Simek

Description

@Simek

Have you read the Troubleshooting section?

Yes

Plugin version

7.5.0

ESLint version

9.28.0

Node.js version

22.15.0

Bug description

When upgrading the eslint-plugin-testing-library to the latest release today I have found out few new ESLint no-node-access rule warnings which seems to be a false-positives.

Steps to reproduce

import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

it('outputs false-positive warnings', async () => {
  render(<button>Test</button>);

  const user = userEvent.setup();
  await user.click(screen.getByText('Test'));
});

Error output/screenshots

Image

ESLint configuration

ESLint flat config chunk related to Testing Library:

  {
    files: ['**/*-test.[jt]s?(x)'],
    ...testingLibrary.configs['flat/react'],
  }

Rule(s) affected

no-node-access

Anything else?

No response

Do you want to submit a pull request to fix this bug?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleased

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions