File tree 2 files changed +37
-8
lines changed
2 files changed +37
-8
lines changed Original file line number Diff line number Diff line change @@ -3006,6 +3006,42 @@ namespace ts.projectSystem {
3006
3006
const errorResult = < protocol . Diagnostic [ ] > session . executeCommand ( dTsFileGetErrRequest ) . response ;
3007
3007
assert . isTrue ( errorResult . length === 0 ) ;
3008
3008
} ) ;
3009
+
3010
+ it ( "should be turned on for js-only external projects with skipLibCheck=false" , ( ) => {
3011
+ const jsFile = {
3012
+ path : "/a/b/file1.js" ,
3013
+ content : "let x =1;"
3014
+ } ;
3015
+ const dTsFile = {
3016
+ path : "/a/b/file2.d.ts" ,
3017
+ content : `
3018
+ interface T {
3019
+ name: string;
3020
+ };
3021
+ interface T {
3022
+ name: number;
3023
+ };`
3024
+ } ;
3025
+ const host = createServerHost ( [ jsFile , dTsFile ] ) ;
3026
+ const session = createSession ( host ) ;
3027
+
3028
+ const openExternalProjectRequest = makeSessionRequest < protocol . OpenExternalProjectArgs > (
3029
+ CommandNames . OpenExternalProject ,
3030
+ {
3031
+ projectFileName : "project1" ,
3032
+ rootFiles : toExternalFiles ( [ jsFile . path , dTsFile . path ] ) ,
3033
+ options : { skipLibCheck : false }
3034
+ }
3035
+ ) ;
3036
+ session . executeCommand ( openExternalProjectRequest ) ;
3037
+
3038
+ const dTsFileGetErrRequest = makeSessionRequest < protocol . SemanticDiagnosticsSyncRequestArgs > (
3039
+ CommandNames . SemanticDiagnosticsSync ,
3040
+ { file : dTsFile . path }
3041
+ ) ;
3042
+ const errorResult = < protocol . Diagnostic [ ] > session . executeCommand ( dTsFileGetErrRequest ) . response ;
3043
+ assert . isTrue ( errorResult . length === 0 ) ;
3044
+ } ) ;
3009
3045
} ) ;
3010
3046
3011
3047
describe ( "non-existing directories listed in config file input array" , ( ) => {
Original file line number Diff line number Diff line change @@ -26,14 +26,7 @@ namespace ts.server {
26
26
}
27
27
28
28
function shouldSkipSematicCheck ( project : Project ) {
29
- if ( project . getCompilerOptions ( ) . skipLibCheck !== undefined ) {
30
- return false ;
31
- }
32
-
33
- if ( ( project . projectKind === ProjectKind . Inferred || project . projectKind === ProjectKind . External ) && project . isJsOnlyProject ( ) ) {
34
- return true ;
35
- }
36
- return false ;
29
+ return ( project . projectKind === ProjectKind . Inferred || project . projectKind === ProjectKind . External ) && project . isJsOnlyProject ( ) ;
37
30
}
38
31
39
32
interface FileStart {
You can’t perform that action at this time.
0 commit comments