mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Refactor configuration schema to use oneOf instead of type:Array for better extensibility.
This commit is contained in:
parent
a1785270fa
commit
9065f74bb8
5 changed files with 3780 additions and 2898 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue