From 785e413f72b01bd8a80336be6e319297db45d0c8 Mon Sep 17 00:00:00 2001 From: timdeschryver <28659384+timdeschryver@users.noreply.github.com> Date: Mon, 6 Apr 2020 21:33:21 +0200 Subject: [PATCH] fix: add missing doc urls --- lib/rules/consistent-data-testid.js | 3 +++ lib/rules/no-manual-cleanup.js | 3 +++ tests/index.test.js | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/rules/consistent-data-testid.js b/lib/rules/consistent-data-testid.js index 9c06c362..1eb687dc 100644 --- a/lib/rules/consistent-data-testid.js +++ b/lib/rules/consistent-data-testid.js @@ -1,5 +1,7 @@ 'use strict'; +const { getDocsUrl } = require('../utils'); + const FILENAME_PLACEHOLDER = '{fileName}'; module.exports = { @@ -8,6 +10,7 @@ module.exports = { description: 'Ensures consistent usage of `data-testid`', category: 'Best Practices', recommended: false, + url: getDocsUrl('consistent-data-testid'), }, messages: { invalidTestId: '`{{attr}}` "{{value}}" should match `{{regex}}`', diff --git a/lib/rules/no-manual-cleanup.js b/lib/rules/no-manual-cleanup.js index 4a53e35a..15ed9065 100644 --- a/lib/rules/no-manual-cleanup.js +++ b/lib/rules/no-manual-cleanup.js @@ -1,5 +1,7 @@ 'use strict'; +const { getDocsUrl } = require('../utils'); + const CLEANUP_LIBRARY_REGEX = /(@testing-library\/(preact|react|svelte|vue))|@marko\/testing-library/; module.exports = { @@ -9,6 +11,7 @@ module.exports = { description: ' Disallow the use of `cleanup`', category: 'Best Practices', recommended: false, + url: getDocsUrl('no-manual-cleanup'), }, messages: { noManualCleanup: diff --git a/tests/index.test.js b/tests/index.test.js index 700a66f9..5ec73aa0 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -4,7 +4,7 @@ const { configs, rules } = require('../lib'); const fs = require('fs'); const path = require('path'); -const rulesModules = fs.readdirSync(path.join(__dirname, '/lib/rules')); +const rulesModules = fs.readdirSync(path.join(__dirname, '../lib/rules')); it('should export all available rules', () => { const availableRules = rulesModules.map(module => module.replace('.js', ''));