fix(doclint): fix doclint for new typescript (#879)

Some types now have `innerTypeNames.length === 0`. Fun!
This commit is contained in:
Joel Einbinder 2020-02-06 16:26:36 -08:00 committed by GitHub
parent ffc8f961da
commit ffc1022717
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -222,9 +222,9 @@ function checkSources(sources, externalDependencies) {
properties.push(...innerType.properties);
innerTypeNames.push(innerType.name);
}
if (innerTypeNames.length === 1 && innerTypeNames[0] === 'void')
return new Documentation.Type(type.symbol.name);
return new Documentation.Type(`${type.symbol.name}<${innerTypeNames.join(', ')}>`, properties);
if (innerTypeNames.length === 0 || (innerTypeNames.length === 1 && innerTypeNames[0] === 'void'))
return new Documentation.Type(expandPrefix(type.symbol.name));
return new Documentation.Type(`${expandPrefix(type.symbol.name)}<${innerTypeNames.join(', ')}>`, properties);
}
return new Documentation.Type(expandPrefix(typeName), []);
}