Skip to content

TS importModuleSpecifier could work better for lerna monorepos with libs only #36624

Closed
@lgraziani2712

Description

@lgraziani2712

TS Template added by @mjbvz

TypeScript Version: 3.8.0

Search Terms

  • importModuleSpecifier
  • auto import
  • mono repo / monorepo

Related issue: #36181 (I thought was something related to TS itself, but maybe is not).

Right now, the typescript.preferences.importModuleSpecifier auto option only uses relative paths for files nearer to the actual file than the basePath configuration file. But this isn't the best approach for a monorepo full with libs.

I only want to have aliases on imports from other lib folders, but I want to keep every import within a lib as relative imports. The problem is, VSCode suggestions sometimes adds the alias to imports within files of the same lib. When I build and publish everything as is, the service using that lib will crash because doesn't understand the alias.

Thank you in advance!

Metadata

Metadata

Assignees

Labels

Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions