From 40c27b9a15bf1c1ac485101759d1bc0900543a1d Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 13 Jul 2022 11:37:34 +0200 Subject: [PATCH] api-extractor: warn about unnecessarily allowing warnings Signed-off-by: Patrik Oldsberg --- scripts/api-extractor.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 21a307b65a..a7f36136cc 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -241,7 +241,6 @@ const ALLOW_WARNINGS = [ 'plugins/kafka', 'plugins/kafka-backend', 'plugins/kubernetes', - 'plugins/kubernetes-backend', 'plugins/kubernetes-common', 'plugins/lighthouse', 'plugins/newrelic', @@ -566,6 +565,11 @@ async function runApiExtraction({ `The API Report for ${packageDir} is not allowed to have warnings`, ); } + if (warningCountAfter === 0 && ALLOW_WARNINGS.includes(packageDir)) { + console.log( + `No need to allow warnings for ${packageDir}, it does not have any`, + ); + } if (warningCountAfter > warningCountBefore) { warnings.push( `The API Report for ${packageDir} introduces new warnings. ` +