Skip to content

When looking up modules in @types, only look for index.d.ts and `pa…#11926

Merged
3 commits merged into
masterfrom
module_resolution_fixes
Nov 11, 2016
Merged

When looking up modules in @types, only look for index.d.ts and `pa…#11926
3 commits merged into
masterfrom
module_resolution_fixes

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Oct 28, 2016

Also makes some of the code neater.

host: ModuleResolutionHost;
// We only use this subset of the compiler options.
compilerOptions: { rootDirs?: string[], baseUrl?: string, paths?: MapLike<string[]> };
compilerOptions: CompilerOptions;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Turns out that since CompilerOptions consists only of optional properties, anything can be assigned to it. So while I thought I was statically ensuring that these were the only compiler options used, we actually use several others, by passing this into a parameter of type CompilerOptions and then accessing them.

currentDirectory = host.getCurrentDirectory();
}

return currentDirectory !== undefined && getDefaultTypeRoots(currentDirectory, host);
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This line actually returns string[] | false.

@ghost ghost assigned vladima Oct 28, 2016
@ghost ghost force-pushed the module_resolution_fixes branch from a748444 to 823d385 Compare November 11, 2016 20:50
@DanielRosenwasser
Copy link
Copy Markdown
Member

DanielRosenwasser commented Nov 11, 2016

Is this just to speed resolution up? Is there an issue tracking this?

@ghost
Copy link
Copy Markdown
Author

ghost commented Nov 11, 2016

This is just for neatness. We shouldn't be publishing .ts and .tsx files to @types anyway.

@ghost ghost merged commit 382891f into master Nov 11, 2016
@ghost ghost deleted the module_resolution_fixes branch November 11, 2016 21:17
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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.

3 participants