Skip to content

Commit 4773944

Browse files
committed
fix(powerlines): Ensure importer has full resolver priority when provided
1 parent a51e483 commit 4773944

File tree

1 file changed

+32
-26
lines changed
  • packages/powerlines/src/_internal

1 file changed

+32
-26
lines changed

packages/powerlines/src/_internal/vfs.ts

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -395,19 +395,22 @@ export class VirtualFileSystem implements VirtualFileSystemInterface {
395395
paths.push(importer);
396396
}
397397

398-
paths.push(this.#context.workspaceConfig.workspaceRoot);
399-
paths.push(
400-
appendPath(
401-
this.#context.config.root,
402-
this.#context.workspaceConfig.workspaceRoot
403-
)
404-
);
405-
paths.push(
406-
appendPath(
407-
joinPaths(this.#context.config.root, "src"),
408-
this.#context.workspaceConfig.workspaceRoot
409-
)
410-
);
398+
if (!importer) {
399+
paths.push(this.#context.workspaceConfig.workspaceRoot);
400+
paths.push(
401+
appendPath(
402+
this.#context.config.root,
403+
this.#context.workspaceConfig.workspaceRoot
404+
)
405+
);
406+
paths.push(
407+
appendPath(
408+
joinPaths(this.#context.config.root, "src"),
409+
this.#context.workspaceConfig.workspaceRoot
410+
)
411+
);
412+
}
413+
411414
paths.push(
412415
...(
413416
Object.keys(this.#context.tsconfig?.options?.paths ?? {})
@@ -503,19 +506,22 @@ export class VirtualFileSystem implements VirtualFileSystemInterface {
503506
paths.push(importer);
504507
}
505508

506-
paths.push(this.#context.workspaceConfig.workspaceRoot);
507-
paths.push(
508-
appendPath(
509-
this.#context.config.root,
510-
this.#context.workspaceConfig.workspaceRoot
511-
)
512-
);
513-
paths.push(
514-
appendPath(
515-
joinPaths(this.#context.config.root, "src"),
516-
this.#context.workspaceConfig.workspaceRoot
517-
)
518-
);
509+
if (!importer) {
510+
paths.push(this.#context.workspaceConfig.workspaceRoot);
511+
paths.push(
512+
appendPath(
513+
this.#context.config.root,
514+
this.#context.workspaceConfig.workspaceRoot
515+
)
516+
);
517+
paths.push(
518+
appendPath(
519+
joinPaths(this.#context.config.root, "src"),
520+
this.#context.workspaceConfig.workspaceRoot
521+
)
522+
);
523+
}
524+
519525
paths.push(
520526
...(
521527
Object.keys(this.#context.tsconfig?.options?.paths ?? {})

0 commit comments

Comments
 (0)