api-extractor: warn about unnecessarily allowing warnings

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-07-13 11:37:34 +02:00
parent 74ed37a31e
commit 40c27b9a15
+5 -1
View File
@@ -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. ` +