Skip to content

Commit 64eaba0

Browse files
committedMar 3, 2025·
fix: address comments in PR
1 parent 1ae902a commit 64eaba0

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed
 

‎README.md

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ These rules enforce some of the [best practices recommended for using Cypress](h
5454
| [no-force](docs/rules/no-force.md) | disallow using `force: true` with action commands | |
5555
| [no-pause](docs/rules/no-pause.md) | disallow using `cy.pause()` calls | |
5656
| [no-unnecessary-waiting](docs/rules/no-unnecessary-waiting.md) | disallow waiting for arbitrary time periods ||
57+
| [no-xpath](docs/rules/no-xpath.md) | disallow usage of xpath in selector | |
5758
| [require-data-selectors](docs/rules/require-data-selectors.md) | require `data-*` attribute selectors | |
5859
| [unsafe-to-chain-command](docs/rules/unsafe-to-chain-command.md) | disallow actions within chains ||
5960

‎docs/rules/no-xpath.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Disallow usage of cypress xpath (`no-xpath`)
1+
# Disallow using `cy.xpath() calls (`cypress/no-xpath`)
2+
3+
<!-- end auto-generated rule header -->
24

35
This rule disallow the usage of cypress-xpath for selecting elements.
46

@@ -21,7 +23,7 @@ cy.get('[data-cy="container"]').click();
2123

2224
## Further Reading
2325

24-
`cypress-xpath` package has been deprecated since Oct 13, 2022.
26+
Both `@cypress/xpath` and `cypress-xpath` packages have been deprecated since Oct 13, 2022.
2527

2628

2729
See [the Cypress Best Practices guide](https://docs.cypress.io/guides/references/best-practices.html#Selecting-Elements).

‎lib/rules/no-xpath.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
meta: {
55
type: 'suggestion',
66
docs: {
7-
description: "disallow usage of xpath in selector",
7+
description: "disallow using cy.xpath() calls",
88
recommended: false,
99
url: "https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-xpath.md"
1010
},

0 commit comments

Comments
 (0)
Please sign in to comment.