Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Apr 23, 2018

Fixes #23598 and #23011

  • We will no longer import from a re-export from "./index" (or "../index` or "../../index"...).
  • We will still import if the original export is from "./index".
  • We will still import from "./foo/index" over "./foo/bar".

@ghost ghost requested review from mhegazy and sheetalkamat April 23, 2018 15:10
// Ignore something in `./index` or `../index` if it's not the original exporting module.
if (moduleFile &&
exportedSymbol.parent !== moduleSymbol &&
removeFileExtension(getBaseFileName(moduleFile.fileName)) === "index" &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checking index.ts seems wrong. Wouldnt it depend on package.json and "main" field in there?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this issue is related to package.json existing.
Although we could generalize the fix to any re-export in the same or an ancestor directory without involving the name "index".

@ghost ghost merged commit cdfd92b into master Apr 25, 2018
@ghost ghost deleted the completionsImport_notFromIndex branch April 25, 2018 23:15
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants