From aae437cb1e2840fee917d6288458956251e0c16b Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Tue, 13 Mar 2018 11:24:05 +0000 Subject: [PATCH] build(aio): implement rules to prevent short parameter names (#22759) PR Close #22759 --- aio/tools/transforms/angular-api-package/index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/aio/tools/transforms/angular-api-package/index.js b/aio/tools/transforms/angular-api-package/index.js index 79216b41fe..6a9d64cbaa 100644 --- a/aio/tools/transforms/angular-api-package/index.js +++ b/aio/tools/transforms/angular-api-package/index.js @@ -120,9 +120,16 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage]) }) .config(function(checkContentRules, EXPORT_DOC_TYPES) { - const createNoMarkdownHeadings = require('./content-rules/noMarkdownHeadings'); - const noMarkdownHeadings = createNoMarkdownHeadings(); - const allowOnlyLevel3Headings = createNoMarkdownHeadings(1, 2, '4,'); + // Min length rules + const createMinLengthRule = require('./content-rules/minLength'); + const paramRuleSet = checkContentRules.docTypeRules['parameter'] = checkContentRules.docTypeRules['parameter'] || {}; + const paramRules = paramRuleSet['name'] = paramRuleSet['name'] || []; + paramRules.push(createMinLengthRule()); + + // Heading rules + const createNoMarkdownHeadingsRule = require('./content-rules/noMarkdownHeadings'); + const noMarkdownHeadings = createNoMarkdownHeadingsRule(); + const allowOnlyLevel3Headings = createNoMarkdownHeadingsRule(1, 2, '4,'); const DOC_TYPES_TO_CHECK = EXPORT_DOC_TYPES.concat(['member', 'overload-info']); const PROPS_TO_CHECK = ['description', 'shortDescription'];