From 8ac4dd644706f58f9f3ae3e1cbf45e66626ce107 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Thu, 20 Sep 2018 20:48:18 +0100 Subject: [PATCH] build(docs-infra): allow usage notes on decorator option properties (#26039) PR Close #26039 --- aio/tools/transforms/angular-api-package/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aio/tools/transforms/angular-api-package/index.js b/aio/tools/transforms/angular-api-package/index.js index 8c86ed4bce..c3288f1324 100644 --- a/aio/tools/transforms/angular-api-package/index.js +++ b/aio/tools/transforms/angular-api-package/index.js @@ -253,7 +253,12 @@ function addAllowedPropertiesRules(checkContentRules, API_CONTAINED_DOC_TYPES) { const ruleSet = checkContentRules.docTypeRules[docType] = checkContentRules.docTypeRules[docType] || {}; 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.`); }); }