-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Don't emit any source files found under node_modules #9421
Conversation
@@ -1378,7 +1378,7 @@ namespace ts { | |||
getSourceFile: program.getSourceFile, | |||
getSourceFileByPath: program.getSourceFileByPath, | |||
getSourceFiles: program.getSourceFiles, | |||
getFilesFromNodeModules: () => jsFilesFoundSearchingNodeModules, | |||
isSourceFileFromNodeModules: (file: SourceFile) => !!lookUp(sourceFilesFoundSearchingNodeModules, file.path), |
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.
we have isExternalLibraryImport
, so why not call this isSourceFileFromExternalLibrary
?
👍 |
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/@...'. |
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 causing the issue in the GitHub build... need to figure out where the full path is creeping in to the error message.
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. |
Port #9421 to not compile files under from node_modules
This fixes #6964 to suppress emit for any source files located by searching in node_modules, not just JavaScript files.