From c0fb53d3bcfcf7ff398ba915083cdb26580fefb6 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Mon, 6 Jun 2022 20:17:31 -0400 Subject: [PATCH] clean: remove redundant `allImportedFiles` check in `_onwrite` (#346) - this checks if any of the files in `parsedConfig.fileNames` are _not_ in `allImportedFiles`, but all the files in `parsedConfig.fileNames` are explicitly added in the `options` hook on line 98 - so this is redundant / dead code; the check will never be true - this can be considered a remnant of an old bug as an old commit fixed a bug with `allImportedFiles` after it was released: https://github.com/ezolenko/rollup-plugin-typescript2/commit/f24359e668324124a2de40f955a0ff206bf2cf86 --- src/index.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index 1730d64..5e14ad4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -306,11 +306,6 @@ const typescript: PluginImpl = (options) => const key = normalize(name); if (key in declarations) return; - if (!allImportedFiles.has(key)) - { - context.debug(() => `skipping declarations for unused '${key}'`); - return; - } context.debug(() => `generating missed declarations for '${key}'`); const output = service.getEmitOutput(key, true);