diff --git a/.eslintrc.json b/.eslintrc.json index 5c433f50..d1a5a7af 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -15,6 +15,12 @@ "plugin:mocha/recommended" ], "rules": { + "eslint-plugin/require-meta-docs-url": [ + "error", + { + "pattern": "https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/{{name}}.md" + } + ], "n/no-extraneous-require": [ "error", { diff --git a/lib/rules/assertion-before-screenshot.js b/lib/rules/assertion-before-screenshot.js index 74b7e9c8..f9465808 100644 --- a/lib/rules/assertion-before-screenshot.js +++ b/lib/rules/assertion-before-screenshot.js @@ -21,6 +21,7 @@ module.exports = { description: 'Assert on the page state before taking a screenshot, so the screenshot is consistent', category: 'Possible Errors', recommended: false, + url: 'https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/assertion-before-screenshot.md', }, schema: [], messages: { diff --git a/lib/rules/no-assigning-return-values.js b/lib/rules/no-assigning-return-values.js index ba09098c..00ac7c6b 100644 --- a/lib/rules/no-assigning-return-values.js +++ b/lib/rules/no-assigning-return-values.js @@ -22,7 +22,7 @@ module.exports = { description: 'Prevent assigning return values of cy calls', category: 'Possible Errors', recommended: true, - url: 'https://on.cypress.io/best-practices#Assigning-Return-Values', + url: 'https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-assigning-return-values.md', }, schema: [], messages: { diff --git a/lib/rules/no-async-before.js b/lib/rules/no-async-before.js index d83144f1..5f8b4b35 100644 --- a/lib/rules/no-async-before.js +++ b/lib/rules/no-async-before.js @@ -7,6 +7,7 @@ module.exports = { description: 'Prevent using async/await in Cypress before methods', category: 'Possible Errors', recommended: true, + url: 'https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-async-before.md', }, schema: [], messages: { diff --git a/lib/rules/no-async-tests.js b/lib/rules/no-async-tests.js index bb155479..e253ecff 100644 --- a/lib/rules/no-async-tests.js +++ b/lib/rules/no-async-tests.js @@ -7,6 +7,7 @@ module.exports = { description: 'Prevent using async/await in Cypress test cases', category: 'Possible Errors', recommended: true, + url: 'https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-async-tests.md', }, schema: [], messages: { diff --git a/lib/rules/no-force.js b/lib/rules/no-force.js index ec47f984..4e320f90 100644 --- a/lib/rules/no-force.js +++ b/lib/rules/no-force.js @@ -11,6 +11,7 @@ module.exports = { description: 'Disallow using of \'force: true\' option for click and type calls', category: 'Possible Errors', recommended: false, + url: 'https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-force.md', }, fixable: null, // or "code" or "whitespace" schema: [], diff --git a/lib/rules/no-pause.js b/lib/rules/no-pause.js index 44919321..a8fa63a9 100644 --- a/lib/rules/no-pause.js +++ b/lib/rules/no-pause.js @@ -11,6 +11,7 @@ module.exports = { description: 'Disallow using of \'cy.pause\' calls', category: 'Possible Errors', recommended: false, + url: 'https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-pause.md', }, fixable: null, // or "code" or "whitespace" schema: [], diff --git a/lib/rules/no-unnecessary-waiting.js b/lib/rules/no-unnecessary-waiting.js index db073d90..e5f26d74 100644 --- a/lib/rules/no-unnecessary-waiting.js +++ b/lib/rules/no-unnecessary-waiting.js @@ -7,7 +7,7 @@ module.exports = { description: 'Prevent waiting for arbitrary time periods', category: 'Possible Errors', recommended: true, - url: 'https://on.cypress.io/best-practices#Unnecessary-Waiting', + url: 'https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-unnecessary-waiting.md', }, schema: [], messages: { diff --git a/lib/rules/require-data-selectors.js b/lib/rules/require-data-selectors.js index c4cf1693..ddb27468 100644 --- a/lib/rules/require-data-selectors.js +++ b/lib/rules/require-data-selectors.js @@ -4,10 +4,10 @@ module.exports = { meta: { type: 'suggestion', docs: { - description: 'Use data-* attributes to provide context to your selectors and insulate them from CSS or JS changes https://docs.cypress.io/guides/references/best-practices.html#Selecting-Elements', + description: 'Use 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', + url: 'https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/require-data-selectors.md', }, schema: [], messages: { diff --git a/lib/rules/unsafe-to-chain-command.js b/lib/rules/unsafe-to-chain-command.js index fb2e7b12..6a118304 100644 --- a/lib/rules/unsafe-to-chain-command.js +++ b/lib/rules/unsafe-to-chain-command.js @@ -74,7 +74,7 @@ module.exports = { description: DESCRIPTION, category: 'Possible Errors', recommended: true, - url: 'https://docs.cypress.io/guides/core-concepts/retry-ability#Actions-should-be-at-the-end-of-chains-not-the-middle', + url: 'https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/unsafe-to-chain-command.md', }, schema: [schema], messages: {