style(docs-infra): format files (#35801)

PR Close #35801
This commit is contained in:
Pete Bacon Darwin
2020-03-02 17:47:06 +00:00
committed by atscott
parent c296bfcaf9
commit c1b5daf5a8
2 changed files with 94 additions and 104 deletions

View File

@ -4,10 +4,14 @@ module.exports = function processCliCommands(createDocMessage) {
$runBefore: ['rendering-docs'],
$process(docs) {
const navigationDoc = docs.find(doc => doc.docType === 'navigation-json');
const navigationNode = navigationDoc && navigationDoc.data['SideNav'].find(node => node.children && node.children.length && node.children[0].url === 'cli');
const navigationNode = navigationDoc &&
navigationDoc.data['SideNav'].find(
node => node.children && node.children.length && node.children[0].url === 'cli');
if (!navigationNode) {
throw new Error(createDocMessage('Missing `cli` url - CLI Commands must include a first child node with url set at `cli`', navigationDoc));
throw new Error(createDocMessage(
'Missing `cli` url - CLI Commands must include a first child node with url set at `cli`',
navigationDoc));
}
docs.forEach(doc => {
@ -18,7 +22,7 @@ module.exports = function processCliCommands(createDocMessage) {
processOptions(doc, doc.options);
// Add to navigation doc
navigationNode.children.push({ url: doc.path, title: `ng ${doc.name}` });
navigationNode.children.push({url: doc.path, title: `ng ${doc.name}`});
}
});
}
@ -31,7 +35,9 @@ function processOptions(container, options) {
options.forEach(option => {
// Ignore any hidden options
if (option.hidden) { return; }
if (option.hidden) {
return;
}
option.types = option.types || [option.type];
option.names = collectNames(option.name, option.aliases);