-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Support reference library directives #7549
Conversation
|
||
function getEffectiveLibraryPrimarySearchPaths() { | ||
return options.librarySearchPaths || | ||
(options.configFilePath ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting... so if the user provides librarySearchPaths
, they effectively override all 3 of the defaults?
Also, why is the configFilePath
added to the front? Does this mean if I have my tsconfig file in my ./src
project root, an it tries to load a jquery
typing, it will first look for ./src/jquery/
(and see if there is a package.json
with a typing
field)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
I removed "" from the list of default search paths.
5f72495
to
c0537cd
Compare
Anyone else care to take a look? |
c0537cd
to
30cb987
Compare
@@ -2155,6 +2155,11 @@ | |||
"category": "Error", | |||
"code": 4082 | |||
}, | |||
"Conflicting library definitions for '{0}' found at '{1}' and '{2}'. Copy the correct file to a local typings folder to resolve this conflict.": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, missing quotes: .. local 'typings' folder ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possibly: Copy the correct file to the local 'typings' folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to suggested text
(options.rootDir && ts.toPath(options.rootDir, currentDirectory, host.getCanonicalFileName)) || | ||
(options.configFilePath && getDirectoryPath(getNormalizedAbsolutePath(options.configFilePath, currentDirectory))); | ||
if (libraryRoot === undefined) { | ||
libraryRoot = computeCommonSourceDirectoryOfFilenames(rootNames); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is kinda unexpected. so tsc a.ts
will result in a different search location from tsc a\a.ts b\b.ts
, even if a.ts
has a reference to b.ts
?
I would say make it an error to try to resolve a library reference, without a root, and ask the user to specify rootDir
.
closing in favor of #7775 |
Implements #7156. I'll update that issue with a more detailed design description