build(aio): implement rules to prevent short parameter names (#22759)

PR Close #22759
This commit is contained in:
Pete Bacon Darwin 2018-03-13 11:24:05 +00:00 committed by Igor Minar
parent fa11d7822c
commit aae437cb1e
1 changed files with 10 additions and 3 deletions

View File

@ -120,9 +120,16 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage])
}) })
.config(function(checkContentRules, EXPORT_DOC_TYPES) { .config(function(checkContentRules, EXPORT_DOC_TYPES) {
const createNoMarkdownHeadings = require('./content-rules/noMarkdownHeadings'); // Min length rules
const noMarkdownHeadings = createNoMarkdownHeadings(); const createMinLengthRule = require('./content-rules/minLength');
const allowOnlyLevel3Headings = createNoMarkdownHeadings(1, 2, '4,'); 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 DOC_TYPES_TO_CHECK = EXPORT_DOC_TYPES.concat(['member', 'overload-info']);
const PROPS_TO_CHECK = ['description', 'shortDescription']; const PROPS_TO_CHECK = ['description', 'shortDescription'];