Don't emit any source files found under node_modules#9421
Merged
Conversation
src/compiler/program.ts
Outdated
| getSourceFileByPath: program.getSourceFileByPath, | ||
| getSourceFiles: program.getSourceFiles, | ||
| getFilesFromNodeModules: () => jsFilesFoundSearchingNodeModules, | ||
| isSourceFileFromNodeModules: (file: SourceFile) => !!lookUp(sourceFilesFoundSearchingNodeModules, file.path), |
Contributor
There was a problem hiding this comment.
we have isExternalLibraryImport, so why not call this isSourceFileFromExternalLibrary ?
Contributor
|
👍 |
Member
Author
Member
Author
|
Hmmm, must have missed a test file in a commit... all passed on my machine. Will take a look shortly. |
| @@ -1,4 +1,5 @@ | |||
| maxDepthIncreased/root.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'. | |||
| maxDepthIncreased/root.ts(7,1): error TS2322: Type 'string' is not assignable to type 'number'. | |||
| maxDepthIncreased/root.ts(8,13): error TS2339: Property 'test' does not exist on type 'typeof "C:/src/TypeScript/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/@...'. | |||
Member
Author
There was a problem hiding this comment.
This is causing the issue in the GitHub build... need to figure out where the full path is creeping in to the error message.
Member
Author
|
I removed that one check causing the full path to be in the error for now. The subsequent line would be in error if the wrong file was referenced anyway, so this doesn't really lose any coverage. Hopefully the tests will be green on the CI server (eventually 😩 ) after this change. |
billti
added a commit
that referenced
this pull request
Jul 1, 2016
Port #9421 to not compile files under from node_modules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #6964 to suppress emit for any source files located by searching in node_modules, not just JavaScript files.