Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

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

Joel Einbinderffc1022717e1
diff --git a/utils/doclint/check_public_api/JSBuilder.js b/utils/doclint/check_public_api/JSBuilder.js
index 8a88dd2215..ee81b9eb8c 100644
--- a/utils/doclint/check_public_api/JSBuilder.js
+++ b/utils/doclint/check_public_api/JSBuilder.js
@@ -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), []);
}