mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Refactor configuration schema to use oneOf instead of type:Array for better extensibility.
This commit is contained in:
parent
895f377860
commit
c4b5d1f937
5 changed files with 3780 additions and 2898 deletions
|
|
@ -12,11 +12,12 @@ for (const rule in configSchema.properties) {
|
|||
const properties = configSchema.properties[rule];
|
||||
configExample[rule + "-description"] = properties.description;
|
||||
configExample[rule] = properties.default;
|
||||
if (properties.properties) {
|
||||
const subproperties = properties.oneOf?.at(-1).properties;
|
||||
if (subproperties) {
|
||||
const ruleExample = {};
|
||||
// eslint-disable-next-line guard-for-in
|
||||
for (const property in properties.properties) {
|
||||
const ruleProperties = properties.properties[property];
|
||||
for (const property in subproperties) {
|
||||
const ruleProperties = subproperties[property];
|
||||
ruleExample[property + "-sub-description"] = ruleProperties.description;
|
||||
ruleExample[property] = ruleProperties.default;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue