From 62443b04a07b37d933ae32a0b9c48e21a5374844 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Fri, 18 May 2018 06:33:12 +0100 Subject: [PATCH] build(aio): do not allow `@usageNotes` on properties (#24000) PR Close #24000 --- aio/tools/transforms/angular-api-package/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/aio/tools/transforms/angular-api-package/index.js b/aio/tools/transforms/angular-api-package/index.js index 0ac6a3dc68..b867a1159e 100644 --- a/aio/tools/transforms/angular-api-package/index.js +++ b/aio/tools/transforms/angular-api-package/index.js @@ -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; +}