Skip to content

Commit e69dd8c

Browse files
committed
distinct module paths
1 parent 64a7e27 commit e69dd8c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/import.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ export function getCodeFixActionByName(
8181
function getModulePathsToImport(options: PluginOptions, project: ts.server.Project): string[] {
8282
const currentDir = project.getCurrentDirectory();
8383

84-
return options.paths.flatMap((dirPath) => {
84+
const modulePaths = options.paths.flatMap((dirPath) => {
8585
return project.readDirectory(path.resolve(currentDir, dirPath), ['.ts', '.js']);
8686
});
87+
88+
return [...new Set(modulePaths)];
8789
}
8890

8991
function getFileNameWithoutExt(filePath: string): string {

0 commit comments

Comments
 (0)