Mostly standardize on putting rule names and tags in code spans in documentation.

This commit is contained in:
David Anson 2022-10-30 15:13:19 -07:00
parent 13b4340747
commit 52044c8181
53 changed files with 326 additions and 325 deletions

View file

@ -5,6 +5,7 @@ import { newLineRe } from "../helpers/helpers.js";
import { deprecatedRuleNames, fixableRuleNames } from "../lib/constants.js";
const pathFor = (relativePath) => new URL(relativePath, import.meta.url);
const inCode = (items) => items.map((item) => `\`${item}\``);
const sortedComma = (items) => items.sort().join(", ");
const linesFrom = (text) => text.split(newLineRe);
@ -28,7 +29,7 @@ for (const rule of rules) {
);
const section = [];
section.push(
`## ${decorator}${name} - ${rule.description}${decorator}`,
`## ${decorator}\`${name}\` - ${rule.description}${decorator}`,
""
);
if (deprecated) {
@ -38,9 +39,9 @@ for (const rule of rules) {
);
}
section.push(
`Tags: ${sortedComma(rule.tags)}`,
`Tags: ${sortedComma(inCode(rule.tags))}`,
"",
`Aliases: ${sortedComma(rule.names.slice(1))}`,
`Aliases: ${sortedComma(inCode(rule.names.slice(1)))}`,
""
);
const ruleData = schema.properties[name];