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.url property #188

Merged
merged 1 commit into from Apr 24, 2024

Conversation

MikeMcC399
Copy link
Collaborator

Issue

The eslint-plugin/require-meta-docs-url rule of eslint-plugin-eslint-plugin requires that the meta.docs.url property is populated.

Rules with no meta.docs.url property defined:

Rule document
assertion-before-screenshot
no-async-before
no-async-tests
no-force
no-pause

The following rule documents contain no detailed contents and instead refer to URLs on the Cypress documentation site:

Rule document Links to
no-assigning-return-values https://on.cypress.io/best-practices#Assigning-Return-Values
no-unnecessary-waiting https://on.cypress.io/best-practices#Unnecessary-Waiting
unsafe-to-chain-command https://docs.cypress.io/guides/core-concepts/retry-ability#Actions-should-be-at-the-end-of-chains-not-the-middle

This single rule document contains both detailed contents and a link to the corresponding Cypress documentation site best practices page:

Rule document Links to
require-data-selectors https://docs.cypress.io/guides/references/best-practices.html#Selecting-Elements

Documentation reference

According to the ESLint documentation Rule Structure:

  • docs: (object) Properties often used for documentation generation and tooling. Required for core rules and optional for custom rules. Custom rules can include additional properties here as needed.

    • url: (string) Specifies the URL at which the full documentation can be accessed. Code editors often use this to provide a helpful link on highlighted rule violations.

Change

Implement the rule eslint-plugin/require-meta-docs-url using the pattern option to populate the meta.docs.url property consistently for all rules:

    "eslint-plugin/require-meta-docs-url": [
      "error",
      {
        "pattern": "https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/{{name}}.md"
      }
    ],

@cypress-app-bot
Copy link

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399 MikeMcC399 marked this pull request as ready for review April 24, 2024 15:23
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.

Checked that the links work. 👍🏻

@jennifer-shehane jennifer-shehane merged commit 131d3a7 into cypress-io:master Apr 24, 2024
6 checks passed
@MikeMcC399
Copy link
Collaborator Author

@jennifer-shehane

Checked that the links work. 👍🏻

Thank you very much! It's always good to have a second pair of eyes to spot anything which slipped past my own checks!

@MikeMcC399 MikeMcC399 deleted the update/meta-url branch April 24, 2024 15:32
@cypress-app-bot
Copy link

🎉 This PR is included in version 3.0.1 🎉

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