Skip to content

Commit db43d27

Browse files
committed
docs: tweak rule notices
1 parent a766255 commit db43d27

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/index.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ describe('all rule files should be exported by the plugin', () => {
2424

2525
describe('rule documentation files have the correct content', () => {
2626
const MESSAGES = {
27-
fixable:
28-
'🔧 This rule is automatically fixable using the `--fix` flag on the command line.',
29-
hasSuggestions:
30-
'💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).',
27+
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.',
28+
hasSuggestions: '💡 This rule provides editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).',
3129
};
3230

33-
for (const ruleFile of ruleFiles) {
31+
ruleFiles.forEach((ruleFile) => {
3432
const ruleName = path.basename(ruleFile, '.js');
3533
const rule = plugin.rules[ruleName];
3634
const documentPath = path.join('docs/rules', `${ruleName}.md`);
@@ -53,17 +51,17 @@ describe('rule documentation files have the correct content', () => {
5351

5452
// Ensure that expected notices are present in the correct order.
5553
let currentLineNumber = 1;
56-
for (const expectedNotice of expectedNotices) {
54+
expectedNotices.forEach((expectedNotice) => {
5755
assert.strictEqual(documentLines[currentLineNumber], '', `${ruleName} includes blank line ahead of ${expectedNotice} notice`);
5856
assert.strictEqual(documentLines[currentLineNumber + 1], MESSAGES[expectedNotice], `${ruleName} includes ${expectedNotice} notice`);
5957
currentLineNumber += 2;
60-
}
58+
});
6159

6260
// Ensure that unexpected notices are not present.
63-
for (const unexpectedNotice of unexpectedNotices) {
61+
unexpectedNotices.forEach((unexpectedNotice) => {
6462
assert.ok(!documentContents.includes(MESSAGES[unexpectedNotice]), `${ruleName} does not include unexpected ${unexpectedNotice} notice`);
65-
}
66-
}
63+
});
64+
});
6765
});
6866

6967
describe('deprecated rules', () => {

0 commit comments

Comments
 (0)