Skip to content

Typescript import paths are suddenly traversing upwards since upgrading from 1.19.3 #44699

@alextreppass

Description

@alextreppass
  • VSCode Version: 1.20.1
  • OS Version: OSX
  • Does this issue occur when all extensions are disabled?: Yes

Given the following files:

  • src/some/path/to/consumer.ts
  • src/some/other/path/util.ts

When editing consumer.ts to import a member of util.ts, VSCode will suggest and import the following:

  • In 1.19.3: import { thing } from 'some/other/path/util';
  • In 1.20.1: import { thing } from '../../other/path/util';

In our codebase, we have the compiler option baseUrl set to ./src. We have no other path-related settings.

Restrictions:

  • I can't change the baseUrl as we don't want to see src/ pre-pended to our imports,
  • We need the full path (without src/ prepended) for easy grepping and refactoring.

Is there a way to get the old behaviour back here?

I've tried playing around with the paths and rootDirs compiler options but have had no luck.

Thanks,

Metadata

Metadata

Assignees

Labels

typescriptTypescript support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions