From 4af47f188772591ecd996eb18a853c2cf1cd83f2 Mon Sep 17 00:00:00 2001 From: Armando Aguirre Date: Thu, 25 Jan 2018 14:06:11 -0800 Subject: [PATCH 1/3] Added NoEmit=true when jsconfig is present --- src/compiler/commandLineParser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index eb9f1e3cf34..bea29d3fc1c 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1795,7 +1795,7 @@ namespace ts { function getDefaultCompilerOptions(configFileName?: string) { const options: CompilerOptions = getBaseFileName(configFileName) === "jsconfig.json" - ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true } + ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, noEmit: true } : {}; return options; } From 25b1d9d6a5c1a0d5cc094dadc9c44514bf26b28d Mon Sep 17 00:00:00 2001 From: Armando Aguirre Date: Thu, 25 Jan 2018 14:48:44 -0800 Subject: [PATCH 2/3] Updated tests --- src/harness/unittests/convertCompilerOptionsFromJson.ts | 8 ++++++-- src/harness/unittests/telemetry.ts | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/harness/unittests/convertCompilerOptionsFromJson.ts b/src/harness/unittests/convertCompilerOptionsFromJson.ts index 0bad2ba1e3a..6a88f2ba67e 100644 --- a/src/harness/unittests/convertCompilerOptionsFromJson.ts +++ b/src/harness/unittests/convertCompilerOptionsFromJson.ts @@ -457,6 +457,7 @@ namespace ts { maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, + noEmit: true, module: ModuleKind.CommonJS, target: ScriptTarget.ES5, noImplicitAny: false, @@ -486,6 +487,7 @@ namespace ts { maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, + noEmit: true, module: ModuleKind.CommonJS, target: ScriptTarget.ES5, noImplicitAny: false, @@ -510,7 +512,8 @@ namespace ts { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, - skipLibCheck: true + skipLibCheck: true, + noEmit: true }, errors: [{ file: undefined, @@ -532,7 +535,8 @@ namespace ts { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, - skipLibCheck: true + skipLibCheck: true, + noEmit: true }, errors: [] } diff --git a/src/harness/unittests/telemetry.ts b/src/harness/unittests/telemetry.ts index 9bb2db73801..5cea42efcf5 100644 --- a/src/harness/unittests/telemetry.ts +++ b/src/harness/unittests/telemetry.ts @@ -185,6 +185,7 @@ namespace ts.projectSystem { allowSyntheticDefaultImports: true, maxNodeModuleJsDepth: 2, skipLibCheck: true, + noEmit: true }; it("sends telemetry for typeAcquisition settings", () => { From d0ab1642fe7327f486b41d97e6c6f81e082403e0 Mon Sep 17 00:00:00 2001 From: TravCav Date: Wed, 31 Jan 2018 15:59:17 -0500 Subject: [PATCH 3/3] Fix for Issue #21512 and code cleanup for Jakefile.js (#21513) * Code cleanup for Jakefile.js Jakefile.js was throwing lint warnings so I cleaned some of them up. * took out jshint flag removed /*jshint esversion: 6 */ --- Jakefile.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Jakefile.js b/Jakefile.js index 87fca36a841..b986d81dacc 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -8,7 +8,6 @@ var child_process = require("child_process"); var fold = require("travis-fold"); var ts = require("./lib/typescript"); - // Variables var compilerDirectory = "src/compiler/"; var serverDirectory = "src/server/"; @@ -86,7 +85,7 @@ var servicesSources = filesFromConfig("./src/services/tsconfig.json"); var cancellationTokenSources = filesFromConfig(path.join(serverDirectory, "cancellationToken/tsconfig.json")); var typingsInstallerSources = filesFromConfig(path.join(serverDirectory, "typingsInstaller/tsconfig.json")); var watchGuardSources = filesFromConfig(path.join(serverDirectory, "watchGuard/tsconfig.json")); -var serverSources = filesFromConfig(path.join(serverDirectory, "tsconfig.json")) +var serverSources = filesFromConfig(path.join(serverDirectory, "tsconfig.json")); var languageServiceLibrarySources = filesFromConfig(path.join(serverDirectory, "tsconfig.library.json")); var typesMapOutputPath = path.join(builtLocalDirectory, 'typesMap.json'); @@ -332,7 +331,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts var startCompileTime = mark(); opts = opts || {}; var compilerPath = useBuiltCompiler ? builtLocalCompiler : LKGCompiler; - var options = "--noImplicitAny --noImplicitThis --alwaysStrict --noEmitOnError --types " + var options = "--noImplicitAny --noImplicitThis --alwaysStrict --noEmitOnError --types "; if (opts.types) { options += opts.types.join(","); } @@ -381,10 +380,10 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts } options += " --target es5"; if (opts.lib) { - options += " --lib " + opts.lib + options += " --lib " + opts.lib; } else { - options += " --lib es5" + options += " --lib es5"; } options += " --noUnusedLocals --noUnusedParameters"; @@ -526,7 +525,7 @@ file(buildProtocolDts, [buildProtocolTs, buildProtocolJs, typescriptServicesDts] complete(); }); ex.run(); -}, { async: true }) +}, { async: true }); // The generated diagnostics map; built for the compiler and for the 'generate-diagnostics' task file(diagnosticInfoMapTs, [processDiagnosticMessagesJs, diagnosticMessagesJson], function () { @@ -646,7 +645,7 @@ compileFile(servicesFile, servicesSources, [builtLocalDirectory, copyright].conc // Stanalone/web definition file using global 'ts' namespace jake.cpR(standaloneDefinitionsFile, nodeDefinitionsFile, { silent: true }); var definitionFileContents = fs.readFileSync(nodeDefinitionsFile).toString(); - definitionFileContents = removeConstModifierFromEnumDeclarations(definitionFileContents) + definitionFileContents = removeConstModifierFromEnumDeclarations(definitionFileContents); fs.writeFileSync(standaloneDefinitionsFile, definitionFileContents); // Official node package definition file, pointed to by 'typings' in package.json @@ -1253,7 +1252,7 @@ task("build-rules-end", [], function () { var lintTargets = compilerSources .concat(harnessSources) // Other harness sources - .concat(["instrumenter.ts"].map(function (f) { return path.join(harnessDirectory, f) })) + .concat(["instrumenter.ts"].map(function (f) { return path.join(harnessDirectory, f); })) .concat(serverSources) .concat(tslintRulesFiles) .concat(servicesSources) @@ -1261,7 +1260,7 @@ var lintTargets = compilerSources .concat(cancellationTokenSources) .concat(["Gulpfile.ts"]) .concat([nodeServerInFile, perftscPath, "tests/perfsys.ts", webhostPath]) - .map(function (p) { return path.resolve(p) }); + .map(function (p) { return path.resolve(p); }); // keep only unique items lintTargets = Array.from(new Set(lintTargets)); @@ -1303,9 +1302,10 @@ desc("Runs tslint on the compiler sources. Optional arguments are: f[iles]=regex task("lint", ["build-rules"], () => { if (fold.isTravis()) console.log(fold.start("lint")); const fileMatcher = process.env.f || process.env.file || process.env.files; + const files = fileMatcher ? `src/**/${fileMatcher}` - : "Gulpfile.ts 'scripts/generateLocalizedDiagnosticMessages.ts' 'scripts/tslint/**/*.ts' 'src/**/*.ts' --exclude 'src/lib/*.d.ts'"; + : `Gulpfile.ts scripts/generateLocalizedDiagnosticMessages.ts "scripts/tslint/**/*.ts" "src/**/*.ts" --exclude "src/lib/*.d.ts"`; const cmd = `node node_modules/tslint/bin/tslint ${files} --formatters-dir ./built/local/tslint/formatters --format autolinkableStylish`; console.log("Linting: " + cmd); jake.exec([cmd], { interactive: true }, () => {