From 4782563ee3e443cdcf8d398bb0c579976753efd0 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 14 Nov 2016 12:46:56 -0800 Subject: [PATCH 1/3] Filter JS files from resolutions sent to VS through shims --- src/services/shims.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/services/shims.ts b/src/services/shims.ts index 4debcb2377412..0aa411536f1b6 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -1060,8 +1060,15 @@ namespace ts { return this.forwardJSONCall(`resolveModuleName('${fileName}')`, () => { const compilerOptions = JSON.parse(compilerOptionsJson); const result = resolveModuleName(moduleName, normalizeSlashes(fileName), compilerOptions, this.host); + const resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined; + if (resolvedFileName && !compilerOptions.allowJs && fileExtensionIs(resolvedFileName, ".js")) { + return { + resolvedFileName: undefined, + failedLookupLocations: undefined + }; + } return { - resolvedFileName: result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined, + resolvedFileName, failedLookupLocations: result.failedLookupLocations }; }); From 57a602b924f54bd7311708eefbda491d1f86f822 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 14 Nov 2016 12:47:04 -0800 Subject: [PATCH 2/3] Include no types in services --- src/services/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/tsconfig.json b/src/services/tsconfig.json index 9c3e068918d5e..a419877bcd863 100644 --- a/src/services/tsconfig.json +++ b/src/services/tsconfig.json @@ -12,7 +12,8 @@ "declaration": true, "target": "es5", "noUnusedLocals": true, - "noUnusedParameters": true + "noUnusedParameters": true, + "types": [] }, "files": [ "../compiler/core.ts", From 964f9c5fe28fdd62ef82478af2a7ce8d850bffa0 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 14 Nov 2016 13:24:03 -0800 Subject: [PATCH 3/3] Make failedLookupLocations an array --- src/services/shims.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/shims.ts b/src/services/shims.ts index 0aa411536f1b6..1c8132793a349 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -1064,7 +1064,7 @@ namespace ts { if (resolvedFileName && !compilerOptions.allowJs && fileExtensionIs(resolvedFileName, ".js")) { return { resolvedFileName: undefined, - failedLookupLocations: undefined + failedLookupLocations: [] }; } return {