build(docs-infra): allow usage notes on decorator option properties (#26039)
PR Close #26039
This commit is contained in:
parent
7f7bc64186
commit
af26914ba9
@ -253,7 +253,12 @@ function addAllowedPropertiesRules(checkContentRules, API_CONTAINED_DOC_TYPES) {
|
|||||||
const ruleSet = checkContentRules.docTypeRules[docType] = checkContentRules.docTypeRules[docType] || {};
|
const ruleSet = checkContentRules.docTypeRules[docType] = checkContentRules.docTypeRules[docType] || {};
|
||||||
|
|
||||||
const rules = ruleSet['usageNotes'] = ruleSet['usageNotes'] || [];
|
const rules = ruleSet['usageNotes'] = ruleSet['usageNotes'] || [];
|
||||||
rules.push((doc, prop, value) => value && !isMethod(doc) &&
|
rules.push((doc, prop, value) =>
|
||||||
|
value &&
|
||||||
|
// methods are allowed to have usage notes
|
||||||
|
!isMethod(doc) &&
|
||||||
|
// options on decorators are allowed to ahve usage notes
|
||||||
|
!(doc.containerDoc && doc.containerDoc.docType === 'decorator') &&
|
||||||
`Invalid property: "${prop}" is not allowed on "${doc.docType}" docs.`);
|
`Invalid property: "${prop}" is not allowed on "${doc.docType}" docs.`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user