From e69dd8c986e7491449ca8c4c96705d6e2cc3fb4f Mon Sep 17 00:00:00 2001 From: Yuku Kotani Date: Sun, 5 Sep 2021 18:48:56 +0900 Subject: [PATCH] distinct module paths --- src/lib/import.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/import.ts b/src/lib/import.ts index ca8eb08..77bd354 100644 --- a/src/lib/import.ts +++ b/src/lib/import.ts @@ -81,9 +81,11 @@ export function getCodeFixActionByName( function getModulePathsToImport(options: PluginOptions, project: ts.server.Project): string[] { const currentDir = project.getCurrentDirectory(); - return options.paths.flatMap((dirPath) => { + const modulePaths = options.paths.flatMap((dirPath) => { return project.readDirectory(path.resolve(currentDir, dirPath), ['.ts', '.js']); }); + + return [...new Set(modulePaths)]; } function getFileNameWithoutExt(filePath: string): string { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy