-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: unsafe-to-chain-command: Fix the false positive of 'focus' regex matching 'focused' #142
fix: unsafe-to-chain-command: Fix the false positive of 'focus' regex matching 'focused' #142
Conversation
|
@dominicfraser good catch! Can you sign the CLA and I will get this merged in. Thanks for your PR! |
No problem! |
@nagash77 any idea when a new release can be cut for this? |
The release is tagged as https://github.com/cypress-io/eslint-plugin-cypress/releases/tag/v2.15.0 however the release failed as far as publishing to npm is concerned:
|
The Circleci error looks like its an error with permissions |
|
I see it now thanks. |
Addresses/ illustrates #140.
In #137 the
unsafe-to-chain-command
added a list of values to use as default unsafe commands.Part of this list was
This is then used to create a regex
Using just the above this could be seen as
/blur|clear|click|focus/
However this regex is over zealous, it matches on
focused
as well asfocus
.Focus is a safe command to chain. It is a query, not an action.
It is specified as safe in https://docs.cypress.io/api/commands/focused#Syntax.
This PR illustrates the problem, with a potential solution. If the implementation is reverted the test fails.