Refactor configuration schema to use oneOf instead of type:Array for better extensibility.

This commit is contained in:
David Anson 2025-09-13 15:35:07 -07:00
parent a1785270fa
commit 9065f74bb8
5 changed files with 3780 additions and 2898 deletions

View file

@ -61,13 +61,14 @@ for (const rule of rules) {
""
);
const ruleData = schema.properties[name];
if (ruleData.properties) {
const ruleProperties = ruleData.oneOf.at(-1).properties;
if (ruleProperties) {
section.push(
"Parameters:",
""
);
for (const property of Object.keys(ruleData.properties).toSorted()) {
const propData = ruleData.properties[property];
for (const property of Object.keys(ruleProperties).toSorted()) {
const propData = ruleProperties[property];
const propType = [ propData.type ]
.flat()
.map((type) => ((type === "array") ? `${propData.items.type}[]` : type))