Skip to content

Support new tsconfig options for reachability checks #725

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

Merged
merged 3 commits into from
Nov 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions dist/main/tsconfig/tsconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ 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 },
allowUnreachableCode: { type: types.boolean },
allowUnusedLabels: { type: types.boolean },
charset: { type: types.string },
codepage: { type: types.number },
declaration: { type: types.boolean },
diagnostics: { type: types.boolean },
Expand All @@ -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 },
Expand Down Expand Up @@ -301,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;
}
Expand Down Expand Up @@ -374,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");
Expand Down Expand Up @@ -500,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);
Expand Down
12 changes: 10 additions & 2 deletions lib/main/tsconfig/tsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ var types = simpleValidator.types;
*/
interface CompilerOptions {
allowNonTsExtensions?: boolean;
allowUnreachableCode?: boolean;
allowUnusedLabels?: boolean;
charset?: string;
codepage?: number;
declaration?: boolean;
Expand All @@ -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;
Expand All @@ -61,8 +65,10 @@ interface CompilerOptions {
}

var compilerOptionsValidation: simpleValidator.ValidationInfo = {
allowNonTsExtensions: { type: simpleValidator.types.boolean },
charset: { type: simpleValidator.types.string },
allowNonTsExtensions: { type: types.boolean },
allowUnreachableCode: { type: types.boolean },
allowUnusedLabels: { type: types.boolean },
charset: { type: types.string },
codepage: { type: types.number },
declaration: { type: types.boolean },
diagnostics: { type: types.boolean },
Expand All @@ -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 },
Expand Down