Skip to content

Auto import generates wrong module specifier for a/index.ts when a.ts exists #36730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
andrewbranch opened this issue Feb 11, 2020 · 0 comments
Assignees
Labels
Bug A bug in TypeScript Domain: Auto-import Fix Available A PR has been opened for this issue Rescheduled This issue was previously scheduled to an earlier milestone

Comments

@andrewbranch
Copy link
Member

TypeScript Version: 3.8.1-rc

Search Terms: auto import index

Code

// tsconfig.json
{
  "compilerOptions": {
    "module": "commonjs" // ensures `importModuleSpecifierEnding` defaults to `Ending.Minimal`
  }
}

// a/index.ts
export const aIndex = 0;

// a.ts
export {}

// index.ts
aIndex/* auto-import here */

Expected behavior:
Module specifier from auto-import is "./a/index"

Actual behavior:
Module specifier is "./a"

Related Issues: #36725 #24779

@andrewbranch andrewbranch added Bug A bug in TypeScript Domain: Auto-import labels Feb 11, 2020
@andrewbranch andrewbranch self-assigned this Feb 11, 2020
@andrewbranch andrewbranch added this to the Backlog milestone Mar 31, 2020
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Feb 4, 2021
@RyanCavanaugh RyanCavanaugh added the Rescheduled This issue was previously scheduled to an earlier milestone label Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Auto-import Fix Available A PR has been opened for this issue Rescheduled This issue was previously scheduled to an earlier milestone
Projects
None yet
3 participants