Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed May 22, 2023
1 parent 56f7597 commit a4e1dfe
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 56 deletions.
47 changes: 10 additions & 37 deletions README.md
Expand Up @@ -119,46 +119,19 @@ For more, see the [ESLint rules](https://eslint.org/docs/user-guide/configuring/
💼 Configurations enabled in.\
✅ Set in the `recommended` configuration.

| Name                        | Description | 💼 |
| :----------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------- | :- |
| [assertion-before-screenshot](docs/rules/assertion-before-screenshot.md) | Require asserting on the page state before taking a screenshot, so the screenshot is consistent | |
| [no-assigning-return-values](docs/rules/no-assigning-return-values.md) | Disallow assigning return values of cy calls ||
| [no-async-tests](docs/rules/no-async-tests.md) | Disallow using async/await in Cypress test cases ||
| [no-force](docs/rules/no-force.md) | Disallow using of 'force: true' option for click and type calls | |
| [no-pause](docs/rules/no-pause.md) | Disallow using of `cy.pause` calls | |
| [no-unnecessary-waiting](docs/rules/no-unnecessary-waiting.md) | Disallow waiting for arbitrary time periods ||
| [require-data-selectors](docs/rules/require-data-selectors.md) | Require `data-*` attribute selectors | |
| [unsafe-to-chain-command](docs/rules/unsafe-to-chain-command.md) | Require actions to be in the end of chains, not in the middle ||
| Name                        | Description | 💼 |
| :----------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------- | :- |
| [assertion-before-screenshot](docs/rules/assertion-before-screenshot.md) | Require asserting on the page state before taking a screenshot, so the screenshot is consistent | |
| [no-assigning-return-values](docs/rules/no-assigning-return-values.md) | Disallow assigning return values of cy calls ||
| [no-async-tests](docs/rules/no-async-tests.md) | Disallow using async/await in Cypress test cases ||
| [no-force](docs/rules/no-force.md) | Disallow using of 'force: true' option for click and type calls | |
| [no-pause](docs/rules/no-pause.md) | Disallow using of `cy.pause` calls | |
| [no-unnecessary-waiting](docs/rules/no-unnecessary-waiting.md) | Disallow waiting for arbitrary time periods ||
| [require-data-selectors](docs/rules/require-data-selectors.md) | Require using `data-*` attributes to provide context to your selectors and insulate them from CSS or JS changes | |
| [unsafe-to-chain-command](docs/rules/unsafe-to-chain-command.md) | Require actions to be in the end of chains, not in the middle ||

<!-- end auto-generated rules list -->

**NOTE**: These rules currently require eslint 5.0 or greater. If you would like support added for eslint 4.x, please 👍 [this issue](https://github.com/cypress-io/eslint-plugin-cypress/issues/14).

<<<<<<< HEAD
||||||| 874c51f
| | Rule ID | Description |
| :-- | :------------------------------------------------------------------------- | :-------------------------------------------------------------- |
|| [no-assigning-return-values](./docs/rules/no-assigning-return-values.md) | Prevent assigning return values of cy calls |
|| [no-unnecessary-waiting](./docs/rules/no-unnecessary-waiting.md) | Prevent waiting for arbitrary time periods |
|| [no-async-tests](./docs/rules/no-async-tests.md) | Prevent using async/await in Cypress test case |
| | [no-force](./docs/rules/no-force.md) | Disallow using `force: true` with action commands |
| | [assertion-before-screenshot](./docs/rules/assertion-before-screenshot.md) | Ensure screenshots are preceded by an assertion |
| | [require-data-selectors](./docs/rules/require-data-selectors.md) | Only allow data-\* attribute selectors (require-data-selectors) |
| | [no-pause](./docs/rules/no-pause.md) | Disallow `cy.pause()` parent command |

=======
| | Rule ID | Description |
| :-- | :------------------------------------------------------------------------- | :-------------------------------------------------------------- |
|| [no-assigning-return-values](./docs/rules/no-assigning-return-values.md) | Prevent assigning return values of cy calls |
|| [no-unnecessary-waiting](./docs/rules/no-unnecessary-waiting.md) | Prevent waiting for arbitrary time periods |
|| [no-async-tests](./docs/rules/no-async-tests.md) | Prevent using async/await in Cypress test case |
|| [unsafe-to-chain-command](./docs/rules/unsafe-to-chain-command.md) | Prevent chaining from unsafe to chain commands |
| | [no-force](./docs/rules/no-force.md) | Disallow using `force: true` with action commands |
| | [assertion-before-screenshot](./docs/rules/assertion-before-screenshot.md) | Ensure screenshots are preceded by an assertion |
| | [require-data-selectors](./docs/rules/require-data-selectors.md) | Only allow data-\* attribute selectors (require-data-selectors) |
| | [no-pause](./docs/rules/no-pause.md) | Disallow `cy.pause()` parent command |

>>>>>>> master
## Chai and `no-unused-expressions`

Using an assertion such as `expect(value).to.be.true` can fail the ESLint rule `no-unused-expressions` even though it's not an error in this case. To fix this, you can install and use [eslint-plugin-chai-friendly](https://www.npmjs.com/package/eslint-plugin-chai-friendly).
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/require-data-selectors.md
@@ -1,4 +1,4 @@
# Require `data-*` attribute selectors (`cypress/require-data-selectors`)
# Require using `data-*` attributes to provide context to your selectors and insulate them from CSS or JS changes (`cypress/require-data-selectors`)

<!-- end auto-generated rule header -->

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/require-data-selectors.js
Expand Up @@ -3,7 +3,7 @@
module.exports = {
meta: {
docs: {
description: 'Require `data-*` attribute selectors',
description: 'Require using `data-*` attributes to provide context to your selectors and insulate them from CSS or JS changes',
category: 'Possible Errors',
recommended: false,
url: 'https://docs.cypress.io/guides/references/best-practices.html#Selecting-Elements',
Expand Down
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -29,7 +29,7 @@
"@cypress/eslint-plugin-json": "3.2.1",
"condition-circle": "2.0.2",
"eslint": "^5.7.0",
"eslint-doc-generator": "^1.4.1",
"eslint-doc-generator": "^1.4.3",
"eslint-plugin-eslint-plugin": "^2.0.0",
"husky": "^3.0.0",
"jest": "^24.8.0",
Expand Down

0 comments on commit a4e1dfe

Please sign in to comment.