Skip to content

'index' shouldn't be included as part of module path in quick fix #14138

Description

@DanielRosenwasser

Basing this off of my current setup.

Try creating the following folder structure:

  • foo/
    • index.ts
  • bar/
    • index.ts

Contents in foo/index.ts:

export interface Thing {
}

Contents in bar/index.ts:

export let thing: Thing;

Try using the appropriate code action to import Thing. The generated code is currently:

import { Thing } from "../foo/index"; 

The fix is correct, however, most people don't include index as part of their path when importing a module. I'd argue that TypeScript shouldn't either.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: LS: Quick FixesEditor-provided fixes, often called code actions.FixedA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions