Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: standardize meta.docs.description property #192

Merged

Conversation

MikeMcC399
Copy link
Collaborator

@MikeMcC399 MikeMcC399 commented Apr 25, 2024

Issue

The eslint-plugin/require-meta-docs-description rule of eslint-plugin-eslint-plugin requires that the meta.docs.description property is properly populated. In particular it requires each rule to start with one of:

  • enforce
  • require
  • disallow

None of the rule descriptions exactly meet this requirement.

Rule Current README description Current meta.docs.description
no-assigning-return-values Prevent assigning return values of cy calls Prevent assigning return values of cy calls
no-unnecessary-waiting Prevent waiting for arbitrary time periods Prevent waiting for arbitrary time periods
no-async-before missing Prevent using async/await in Cypress before methods
no-async-tests Prevent using async/await in Cypress test case Prevent using async/await in Cypress test cases
unsafe-to-chain-command Prevent chaining from unsafe to chain commands Actions should be in the end of chains, not in the middle
no-force Disallow using force: true with action commands Disallow using of 'force: true' option for click and type calls
assertion-before-screenshot Ensure screenshots are preceded by an assertion Assert on the page state before taking a screenshot, so the screenshot is consistent
require-data-selectors Only allow data-* attribute selectors (require-data-selectors) Use data-* attributes to provide context to your selectors and insulate them from CSS or JS changes
no-pause Disallow cy.pause() parent command Disallow using of 'cy.pause' calls

Furthermore, if the npm module eslint-doc-generator from the ESLint team is used to auto-populate the list of rules in the Rules section of the README file then the meta.docs.description of each rule needs to be more concise.

Documentation reference

Changes

Config changes

Enable the rule eslint-plugin/require-meta-docs-description with the default option.

  "rules": {
    ...
    "eslint-plugin/require-meta-docs-description": "error",
    ...
  }

Content changes

Rule Current README description Current meta.docs.description Proposed meta.docs.description
assertion-before-screenshot Ensure screenshots are preceded by an assertion Assert on the page state before taking a screenshot, so the screenshot is consistent require screenshots to be preceded by an assertion
no-assigning-return-values Prevent assigning return values of cy calls Prevent assigning return values of cy calls disallow assigning return values of cy calls
no-async-before missing Prevent using async/await in Cypress before methods disallow using async/await in Cypress before methods
no-async-tests Prevent using async/await in Cypress test case Prevent using async/await in Cypress test cases disallow using async/await in Cypress test cases
no-force Disallow using force: true with action commands Disallow using of 'force: true' option for click and type calls disallow using force: true with action commands
no-pause Disallow cy.pause() parent command Disallow using of 'cy.pause' calls disallow using cy.pause() calls
no-unnecessary-waiting Prevent waiting for arbitrary time periods Prevent waiting for arbitrary time periods disallow waiting for arbitrary time periods
require-data-selectors Only allow data-* attribute selectors (require-data-selectors) Use data-* attributes to provide context to your selectors and insulate them from CSS or JS changes require data-* attribute selectors
unsafe-to-chain-command Prevent chaining from unsafe to chain commands Actions should be in the end of chains, not in the middle disallow actions within chains

@cypress-app-bot
Copy link

@MikeMcC399 MikeMcC399 self-assigned this Apr 25, 2024
@MikeMcC399 MikeMcC399 marked this pull request as ready for review April 25, 2024 09:22
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that they have formats for descriptions.

@jennifer-shehane jennifer-shehane merged commit 8c83767 into cypress-io:master Apr 25, 2024
8 checks passed
@MikeMcC399
Copy link
Collaborator Author

@jennifer-shehane

Interesting that they have formats for descriptions.

This should help users understand rules better if the same set of restricted verbs (enforce, require & disallow) are used to introduce rules for all the available and different ESLint plugins.

@MikeMcC399 MikeMcC399 deleted the update/meta-description branch April 25, 2024 12:22
@cypress-app-bot
Copy link

🎉 This PR is included in version 3.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants