Skip to content

Conversation

duranbe
Copy link
Contributor

@duranbe duranbe commented Aug 14, 2025

This PR fixes (partially*) #270

Description

  • Fix that when selector as defined as variable and then used in cy.get(), no warning are being thrown. This is being done by first saving variable declaration of aliases or data selectors into a Map, and then when looking at cy.get() command it is also looking up potential use of variable in the map.
  • Update test
  • Update doc

*partially because cross-file declaration does not seems to be feasible, as ESlint only validate file by file.

@cypress-app-bot
Copy link

@MikeMcC399
Copy link
Collaborator

@duranbe

Many thanks for your contribution!

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

@jennifer-shehane jennifer-shehane merged commit 0508b75 into cypress-io:master Aug 14, 2025
10 checks passed
@jennifer-shehane
Copy link
Member

🎉 This PR is included in version 5.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@duranbe duranbe deleted the fix-require-data-selectors branch August 14, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants