testing-library/eslint-plugin-testing-library

Renaming screen import still triggers prefer-screen-queries

abejfehr opened this issue · 0 comments

Have you read the Troubleshooting section?

Yes

Plugin version

v5.10.2

ESLint version

v8.16.0

Node.js version

v16.20.1

package manager and version

yarn 1.22.19

Operating system

macOS Monterey

Bug description

import { screen as rtlScreen } from '@testing-library/react-native';

...

rtlScreen.getByText(...); // fails

Steps to reproduce

  1. enable the prefer-screen-queries lint rule
  2. import screen, but rename it
  3. observe that the lint rule still errors

Error output/screenshots

No response

ESLint configuration

N/A

Rule(s) affected

prefer-screen-queries

Anything else?

No response

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

No