From a4e1dfe60a1c7429ac9428ee7416e51d47b145e2 Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Mon, 22 May 2023 11:11:00 -0400 Subject: [PATCH] fixes --- README.md | 47 ++++++---------------------- docs/rules/require-data-selectors.md | 2 +- lib/rules/require-data-selectors.js | 2 +- package-lock.json | 32 +++++++++---------- package.json | 2 +- 5 files changed, 29 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index f17a50d6..2f00f28a 100644 --- a/README.md +++ b/README.md @@ -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 | ✅ | -**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). diff --git a/docs/rules/require-data-selectors.md b/docs/rules/require-data-selectors.md index b1f6e51f..d2f9150d 100644 --- a/docs/rules/require-data-selectors.md +++ b/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`) diff --git a/lib/rules/require-data-selectors.js b/lib/rules/require-data-selectors.js index 998b66d1..bbf7f439 100644 --- a/lib/rules/require-data-selectors.js +++ b/lib/rules/require-data-selectors.js @@ -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', diff --git a/package-lock.json b/package-lock.json index 19ab721b..5c38d543 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,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", @@ -2560,12 +2560,12 @@ } }, "node_modules/commander": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.1.tgz", - "integrity": "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true, "engines": { - "node": "^12.20.0 || >=14" + "node": ">=14" } }, "node_modules/common-tags": { @@ -3327,15 +3327,15 @@ } }, "node_modules/eslint-doc-generator": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/eslint-doc-generator/-/eslint-doc-generator-1.4.1.tgz", - "integrity": "sha512-OXYdpT3atpY+sKZVwdYs7CYjj51Q0Vm+A4EKc4h6zsgjicq+7S5HOhf8Ps3apWfWNaYzV0RsdKIBhi3ZruL14w==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-doc-generator/-/eslint-doc-generator-1.4.3.tgz", + "integrity": "sha512-cn9KXE7xuKlxKi/9VbirR3cbz7W1geRObwWzZjJAnpTeNBoqA8Rj+lD8/HHHJ7PnOdaTrRyhhoYdCtxqq3U7Bw==", "dev": true, "dependencies": { "@typescript-eslint/utils": "^5.38.1", "ajv": "^8.11.2", "boolean": "^3.2.0", - "commander": "^9.4.0", + "commander": "^10.0.0", "cosmiconfig": "^8.0.0", "deepmerge": "^4.2.2", "dot-prop": "^7.2.0", @@ -18255,9 +18255,9 @@ } }, "commander": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.1.tgz", - "integrity": "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true }, "common-tags": { @@ -18916,15 +18916,15 @@ } }, "eslint-doc-generator": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/eslint-doc-generator/-/eslint-doc-generator-1.4.1.tgz", - "integrity": "sha512-OXYdpT3atpY+sKZVwdYs7CYjj51Q0Vm+A4EKc4h6zsgjicq+7S5HOhf8Ps3apWfWNaYzV0RsdKIBhi3ZruL14w==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-doc-generator/-/eslint-doc-generator-1.4.3.tgz", + "integrity": "sha512-cn9KXE7xuKlxKi/9VbirR3cbz7W1geRObwWzZjJAnpTeNBoqA8Rj+lD8/HHHJ7PnOdaTrRyhhoYdCtxqq3U7Bw==", "dev": true, "requires": { "@typescript-eslint/utils": "^5.38.1", "ajv": "^8.11.2", "boolean": "^3.2.0", - "commander": "^9.4.0", + "commander": "^10.0.0", "cosmiconfig": "^8.0.0", "deepmerge": "^4.2.2", "dot-prop": "^7.2.0", diff --git a/package.json b/package.json index 5af557b1..de93e08e 100644 --- a/package.json +++ b/package.json @@ -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",