From e0693654b70de2e22eb358d6fdfcf2a6685bbe17 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Tue, 7 Jan 2020 14:19:58 -0800 Subject: [PATCH] docs: do not yell at templated types in doc lint (#409) --- utils/doclint/check_public_api/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/doclint/check_public_api/index.js b/utils/doclint/check_public_api/index.js index d779fdb7d8..7c1d919ec6 100644 --- a/utils/doclint/check_public_api/index.js +++ b/utils/doclint/check_public_api/index.js @@ -161,8 +161,11 @@ function compareDocumentations(actual, expected) { const propertyDiff = diff(actualProperties, expectedProperties); for (const propertyName of propertyDiff.extra) errors.push(`Non-existing property found: ${className}.${propertyName}`); - for (const propertyName of propertyDiff.missing) + for (const propertyName of propertyDiff.missing) { + if (propertyName === 'T') + continue; errors.push(`Property not found: ${className}.${propertyName}`); + } const actualEvents = Array.from(actualClass.events.keys()).sort(); const expectedEvents = Array.from(expectedClass.events.keys()).sort(); @@ -192,6 +195,8 @@ function compareDocumentations(actual, expected) { // TODO(@JoelEinbinder): check functions and Serializable if (actual.name.includes('unction') || actual.name.includes('Serializable')) return; + if (expected.name === 'T' || expected.name.includes('[T]')) + return; // We don't have nullchecks on for TypeScript const actualName = actual.name.replace(/[\? ]/g, '').replace(/ElementHandle\/g, 'ElementHandle'); // TypeScript likes to add some spaces