eslint-plugin-cypress 6.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/rules/no-xpath.md +5 -2
- package/lib/rules/no-xpath.js +4 -2
- package/package.json +1 -1
package/docs/rules/no-xpath.md
CHANGED
|
@@ -20,8 +20,11 @@ Examples of **correct** code for this rule:
|
|
|
20
20
|
cy.get('[data-cy="container"]').click()
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Deprecation and Support
|
|
24
|
+
|
|
25
|
+
Both [@cypress/xpath](https://www.npmjs.com/package/@cypress/xpath) and the earlier [cypress-xpath](https://www.npmjs.com/package/cypress-xpath) npm packages are deprecated and no longer supported.
|
|
26
|
+
These packages previously provided the command `cy.xpath()` and they should be uninstalled from the Cypress project after migrating `cy.xpath()` selection to `cy.get()`. See below for more details.
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
## Further Reading
|
|
26
29
|
|
|
27
30
|
See [the Cypress Best Practices guide](https://docs.cypress.io/app/core-concepts/best-practices.html#Selecting-Elements).
|
package/lib/rules/no-xpath.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
meta: {
|
|
5
|
-
type: '
|
|
5
|
+
type: 'problem',
|
|
6
6
|
docs: {
|
|
7
7
|
description: 'disallow using `cy.xpath()` calls',
|
|
8
8
|
recommended: false,
|
|
@@ -11,7 +11,9 @@ module.exports = {
|
|
|
11
11
|
fixable: null, // Or `code` or `whitespace`
|
|
12
12
|
schema: [], // Add a schema if the rule has options
|
|
13
13
|
messages: {
|
|
14
|
-
unexpected:
|
|
14
|
+
unexpected:
|
|
15
|
+
'cy.xpath() is deprecated and unsupported. '
|
|
16
|
+
+ 'Consider using cy.get() with appropriate selectors instead.',
|
|
15
17
|
},
|
|
16
18
|
},
|
|
17
19
|
|