Skip to content

Renaming screen import still triggers prefer-screen-queries #776

Open
@abejfehr

Description

@abejfehr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriagePending to be triaged by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions