cypress-io / eslint-plugin-cypress

An ESLint plugin for projects that use Cypress

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add `unsafe-to-chain-command` exception for `type` and `clear` commands when used together

fuxingloh opened this issue · comments

According to the Cypress documentation on clear, it is considered a correct usage to chain the clear command with the type command, and vice versa:

cy.get('input[name="name"]').clear().type('Jane Lane')
cy.get('input[name="name"]').type('Jane Lane').clear()

As of v2.13.2, the current lint rule does not allow this usage.

commented

@fuxingloh , Thank you for submitting your feature request. Cypress Product Managers will review this request and consider it for future implementation. Please remember we cannot guarantee this will be implemented in a specific timeframe or at all. Please see the Cypress App Product Roadmap for what we currently have in the works.

commented

yes. I just had to ingore this eslint rule. I have too many cases

  cy.getBySel('post.title').find('input').clear().type(newPost.title)

Any update on this change?

It's been a year since this was reported. Can a maintainer at least confirm that this is something that needs to be addressed in the plugin or if the docs aren't completely accurate and the plugin is reporting correctly?

it is dead. just move to playwright

It's been a year since this was reported. Can a maintainer at least confirm that this is something that needs to be addressed in the plugin or if the docs aren't completely accurate and the plugin is reporting correctly?

This PR should fix it but it hasnt been merged. https://github.com/cypress-io/eslint-plugin-cypress/pull/141/files
In the meantime my team decided to use patch-package with the changes in the PR to fix it.

It's been a year since this was reported. Can a maintainer at least confirm that this is something that needs to be addressed in the plugin or if the docs aren't completely accurate and the plugin is reporting correctly?

This PR should fix it but it hasnt been merged. https://github.com/cypress-io/eslint-plugin-cypress/pull/141/files In the meantime my team decided to use patch-package with the changes in the PR to fix it.

Sorry just realized this is on type and clear command chaining and not the chaining custom commands to other commands. My team decided to just un chain them.