build(aio): do not allow `@usageNotes` on properties (#24000)

PR Close #24000
This commit is contained in:
Pete Bacon Darwin 2018-05-18 06:33:12 +01:00 committed by Miško Hevery
parent 3c1eb9413f
commit 62443b04a0
1 changed files with 9 additions and 1 deletions

View File

@ -239,7 +239,15 @@ function addAllowedPropertiesRules(checkContentRules, API_CONTAINED_DOC_TYPES) {
const ruleSet = checkContentRules.docTypeRules[docType] = checkContentRules.docTypeRules[docType] || {};
PROPS_TO_DISALLOW.forEach(prop => {
const rules = ruleSet[prop] = ruleSet[prop] || [];
rules.push((doc, prop, value) => value && `Invalid property: "${prop}" is not allowed on "${doc.docType}" docs.`);
rules.push((doc, prop, value) => {
return value &&
!isMethod(doc) &&
`Invalid property: "${prop}" is not allowed on "${doc.docType}" docs.`;
});
});
});
}
function isMethod(doc) {
return doc.hasOwnProperty('parameters') && !doc.isGetAccessor && !doc.isSetAccessor;
}