mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Address new code analysis issues from previous commit.
This commit is contained in:
parent
34456c5c04
commit
2a06f0a871
1 changed files with 3 additions and 3 deletions
|
|
@ -8,7 +8,7 @@ const maxLineLength = 80;
|
||||||
|
|
||||||
const pathFor = (relativePath) => new URL(relativePath, import.meta.url);
|
const pathFor = (relativePath) => new URL(relativePath, import.meta.url);
|
||||||
const inCode = (items) => items.map((item) => `\`${item}\``);
|
const inCode = (items) => items.map((item) => `\`${item}\``);
|
||||||
const sortedComma = (items) => items.sort().join(", ");
|
const sortedComma = (items) => items.toSorted().join(", ");
|
||||||
const linesFrom = (text) => text.split(newLineRe);
|
const linesFrom = (text) => text.split(newLineRe);
|
||||||
const wrapListItem = (line) => {
|
const wrapListItem = (line) => {
|
||||||
const wrappedLines = [];
|
const wrappedLines = [];
|
||||||
|
|
@ -66,7 +66,7 @@ for (const rule of rules) {
|
||||||
"Parameters:",
|
"Parameters:",
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
for (const property of Object.keys(ruleData.properties).sort()) {
|
for (const property of Object.keys(ruleData.properties).toSorted()) {
|
||||||
const propData = ruleData.properties[property];
|
const propData = ruleData.properties[property];
|
||||||
const propType = [ propData.type ]
|
const propType = [ propData.type ]
|
||||||
.flat()
|
.flat()
|
||||||
|
|
@ -75,7 +75,7 @@ for (const rule of rules) {
|
||||||
const defaultValue = Array.isArray(propData.default) ?
|
const defaultValue = Array.isArray(propData.default) ?
|
||||||
JSON.stringify(propData.default) :
|
JSON.stringify(propData.default) :
|
||||||
propData.default;
|
propData.default;
|
||||||
const allValues = propData.enum?.sort();
|
const allValues = propData.enum?.toSorted();
|
||||||
const listItem = `- \`${property}\`: ${propData.description} (` +
|
const listItem = `- \`${property}\`: ${propData.description} (` +
|
||||||
`\`${propType}\`, default \`${defaultValue}\`` +
|
`\`${propType}\`, default \`${defaultValue}\`` +
|
||||||
(propData.enum ?
|
(propData.enum ?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue