Address new code analysis issues from previous commit.

This commit is contained in:
David Anson 2025-09-09 03:57:57 +00:00
parent 34456c5c04
commit 2a06f0a871

View file

@ -8,7 +8,7 @@ const maxLineLength = 80;
const pathFor = (relativePath) => new URL(relativePath, import.meta.url);
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 wrapListItem = (line) => {
const wrappedLines = [];
@ -66,7 +66,7 @@ for (const rule of rules) {
"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 propType = [ propData.type ]
.flat()
@ -75,7 +75,7 @@ for (const rule of rules) {
const defaultValue = Array.isArray(propData.default) ?
JSON.stringify(propData.default) :
propData.default;
const allValues = propData.enum?.sort();
const allValues = propData.enum?.toSorted();
const listItem = `- \`${property}\`: ${propData.description} (` +
`\`${propType}\`, default \`${defaultValue}\`` +
(propData.enum ?