From db43d275b92b8154618a8c4b7c4b4ec3bf4ef006 Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Thu, 18 Aug 2022 19:24:54 -0400 Subject: [PATCH] docs: tweak rule notices --- tests/index.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/index.js b/tests/index.js index b898dc807a..5728fd3c40 100644 --- a/tests/index.js +++ b/tests/index.js @@ -24,13 +24,11 @@ describe('all rule files should be exported by the plugin', () => { describe('rule documentation files have the correct content', () => { const MESSAGES = { - fixable: - '🔧 This rule is automatically fixable using the `--fix` flag on the command line.', - hasSuggestions: - '💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).', + fixable: '🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line.', + hasSuggestions: '💡 This rule provides editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).', }; - for (const ruleFile of ruleFiles) { + ruleFiles.forEach((ruleFile) => { const ruleName = path.basename(ruleFile, '.js'); const rule = plugin.rules[ruleName]; const documentPath = path.join('docs/rules', `${ruleName}.md`); @@ -53,17 +51,17 @@ describe('rule documentation files have the correct content', () => { // Ensure that expected notices are present in the correct order. let currentLineNumber = 1; - for (const expectedNotice of expectedNotices) { + expectedNotices.forEach((expectedNotice) => { assert.strictEqual(documentLines[currentLineNumber], '', `${ruleName} includes blank line ahead of ${expectedNotice} notice`); assert.strictEqual(documentLines[currentLineNumber + 1], MESSAGES[expectedNotice], `${ruleName} includes ${expectedNotice} notice`); currentLineNumber += 2; - } + }); // Ensure that unexpected notices are not present. - for (const unexpectedNotice of unexpectedNotices) { + unexpectedNotices.forEach((unexpectedNotice) => { assert.ok(!documentContents.includes(MESSAGES[unexpectedNotice]), `${ruleName} does not include unexpected ${unexpectedNotice} notice`); - } - } + }); + }); }); describe('deprecated rules', () => {