From 0876bf406b6f6294ec083af4e86bad6a23c85324 Mon Sep 17 00:00:00 2001 From: Marcus Johnson Date: Sun, 15 Nov 2015 13:46:02 -0700 Subject: [PATCH 1/3] Change 'simplifiedValidator.types' to shortcut 'types' to be consistent --- dist/main/tsconfig/tsconfig.js | 4 ++-- lib/main/tsconfig/tsconfig.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/main/tsconfig/tsconfig.js b/dist/main/tsconfig/tsconfig.js index 2ed270ad8..e61e12c50 100644 --- a/dist/main/tsconfig/tsconfig.js +++ b/dist/main/tsconfig/tsconfig.js @@ -2,8 +2,8 @@ var fsu = require("../utils/fsUtil"); var simpleValidator = require('./simpleValidator'); var types = simpleValidator.types; var compilerOptionsValidation = { - allowNonTsExtensions: { type: simpleValidator.types.boolean }, - charset: { type: simpleValidator.types.string }, + allowNonTsExtensions: { type: types.boolean }, + charset: { type: types.string }, codepage: { type: types.number }, declaration: { type: types.boolean }, diagnostics: { type: types.boolean }, diff --git a/lib/main/tsconfig/tsconfig.ts b/lib/main/tsconfig/tsconfig.ts index 8893e2fe5..c34530448 100644 --- a/lib/main/tsconfig/tsconfig.ts +++ b/lib/main/tsconfig/tsconfig.ts @@ -61,8 +61,8 @@ interface CompilerOptions { } var compilerOptionsValidation: simpleValidator.ValidationInfo = { - allowNonTsExtensions: { type: simpleValidator.types.boolean }, - charset: { type: simpleValidator.types.string }, + allowNonTsExtensions: { type: types.boolean }, + charset: { type: types.string }, codepage: { type: types.number }, declaration: { type: types.boolean }, diagnostics: { type: types.boolean }, From 9b043c7b36c37885bb429df7501a1b2d07ae46b3 Mon Sep 17 00:00:00 2001 From: Marcus Johnson Date: Sun, 15 Nov 2015 13:55:09 -0700 Subject: [PATCH 2/3] Added new tsconfig validation for options introduced in Microsoft/TypeScript#4788 (reachability checks) --- dist/main/tsconfig/tsconfig.js | 4 ++++ lib/main/tsconfig/tsconfig.ts | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/dist/main/tsconfig/tsconfig.js b/dist/main/tsconfig/tsconfig.js index e61e12c50..6d7a00a8d 100644 --- a/dist/main/tsconfig/tsconfig.js +++ b/dist/main/tsconfig/tsconfig.js @@ -3,6 +3,8 @@ var simpleValidator = require('./simpleValidator'); var types = simpleValidator.types; var compilerOptionsValidation = { allowNonTsExtensions: { type: types.boolean }, + allowUnreachableCode: { type: types.boolean }, + allowUnusedLabels: { type: types.boolean }, charset: { type: types.string }, codepage: { type: types.number }, declaration: { type: types.boolean }, @@ -26,7 +28,9 @@ var compilerOptionsValidation = { noEmitHelpers: { type: types.boolean }, noEmitOnError: { type: types.boolean }, noErrorTruncation: { type: types.boolean }, + noFallthroughCasesInSwitch: { type: types.boolean }, noImplicitAny: { type: types.boolean }, + noImplicitReturns: { type: types.boolean }, noLib: { type: types.boolean }, noLibCheck: { type: types.boolean }, noResolve: { type: types.boolean }, diff --git a/lib/main/tsconfig/tsconfig.ts b/lib/main/tsconfig/tsconfig.ts index c34530448..80ccf0de6 100644 --- a/lib/main/tsconfig/tsconfig.ts +++ b/lib/main/tsconfig/tsconfig.ts @@ -17,6 +17,8 @@ var types = simpleValidator.types; */ interface CompilerOptions { allowNonTsExtensions?: boolean; + allowUnreachableCode?: boolean; + allowUnusedLabels?: boolean; charset?: string; codepage?: number; declaration?: boolean; @@ -40,7 +42,9 @@ interface CompilerOptions { noEmitHelpers?: boolean; noEmitOnError?: boolean; noErrorTruncation?: boolean; + noFallthroughCasesInSwitch?: boolean; noImplicitAny?: boolean; // Error on inferred `any` type + noImplicitReturns?: boolean; noLib?: boolean; noLibCheck?: boolean; noResolve?: boolean; @@ -62,6 +66,8 @@ interface CompilerOptions { var compilerOptionsValidation: simpleValidator.ValidationInfo = { allowNonTsExtensions: { type: types.boolean }, + allowUnreachableCode: { type: types.boolean }, + allowUnusedLabels: { type: types.boolean }, charset: { type: types.string }, codepage: { type: types.number }, declaration: { type: types.boolean }, @@ -85,7 +91,9 @@ var compilerOptionsValidation: simpleValidator.ValidationInfo = { noEmitHelpers: { type: types.boolean }, noEmitOnError: { type: types.boolean }, noErrorTruncation: { type: types.boolean }, + noFallthroughCasesInSwitch: { type: types.boolean }, noImplicitAny: { type: types.boolean }, + noImplicitReturns: { type: types.boolean }, noLib: { type: types.boolean }, noLibCheck: { type: types.boolean }, noResolve: { type: types.boolean }, From 9e1ebce040e49ac75eceb8f1db8b848fd3d998b0 Mon Sep 17 00:00:00 2001 From: Marcus Johnson Date: Sun, 15 Nov 2015 13:56:01 -0700 Subject: [PATCH 3/3] This updated generated js appeared so I'm committing it too. Hope that's alright:) --- dist/main/tsconfig/tsconfig.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/main/tsconfig/tsconfig.js b/dist/main/tsconfig/tsconfig.js index 6d7a00a8d..324067c08 100644 --- a/dist/main/tsconfig/tsconfig.js +++ b/dist/main/tsconfig/tsconfig.js @@ -305,8 +305,8 @@ function increaseProjectForReferenceAndImports(files) { var preProcessedFileInfo = ts.preProcessFile(content, true), dir = path.dirname(file); var extensions = ['.ts', '.d.ts', '.tsx']; function getIfExists(filePathNoExt) { - for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { - var ext = extensions_1[_i]; + for (var _i = 0; _i < extensions.length; _i++) { + var ext = extensions[_i]; if (fs.existsSync(filePathNoExt + ext)) { return filePathNoExt + ext; } @@ -378,8 +378,8 @@ function getDefinitionsForNodeModules(projectDir, files) { try { var node_modules = travelUpTheDirectoryTreeTillYouFind(projectDir, 'node_modules', true); var moduleDirs = getDirs(node_modules); - for (var _i = 0, moduleDirs_1 = moduleDirs; _i < moduleDirs_1.length; _i++) { - var moduleDir = moduleDirs_1[_i]; + for (var _i = 0; _i < moduleDirs.length; _i++) { + var moduleDir = moduleDirs[_i]; try { var package_json = JSON.parse(fs.readFileSync(moduleDir + "/package.json").toString()); packagejson.push(moduleDir + "/package.json"); @@ -504,8 +504,8 @@ exports.getPotentiallyRelativeFile = getPotentiallyRelativeFile; function getDirs(rootDir) { var files = fs.readdirSync(rootDir); var dirs = []; - for (var _i = 0, files_1 = files; _i < files_1.length; _i++) { - var file = files_1[_i]; + for (var _i = 0; _i < files.length; _i++) { + var file = files[_i]; if (file[0] != '.') { var filePath = rootDir + "/" + file; var stat = fs.statSync(filePath);