Skip to content
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

implemented treat warning as errors commandline option. #966

Merged
merged 6 commits into from
Nov 17, 2014
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ module ts {
paramType: Diagnostics.KIND,
error: Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd
},
{
name: "noEmitOnError",
type: "boolean",
description: Diagnostics.Do_not_emit_JavaScript_on_error,
},
{
name: "noImplicitAny",
type: "boolean",
Expand Down
1 change: 1 addition & 0 deletions src/compiler/diagnosticInformationMap.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ module ts {
Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: DiagnosticCategory.Message, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." },
Watch_input_files: { code: 6005, category: DiagnosticCategory.Message, key: "Watch input files." },
Redirect_output_structure_to_the_directory: { code: 6006, category: DiagnosticCategory.Message, key: "Redirect output structure to the directory." },
Do_not_emit_JavaScript_on_error: { code: 6007, category: DiagnosticCategory.Message, key: "Do not emit JavaScript on error." },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change this to: "Do not emit outputs if any type checking errors were reported"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“type checking” is a very compiler-team specific term. Really, all we’re trying to say is “Do not emit any outputs if any errors were reported.”

       -- Cyrus

From: Mohamed Hegazy [mailto:notifications@github.com]
Sent: Monday, October 27, 2014 3:38 PM
To: Microsoft/TypeScript
Cc: Cyrus Najmabadi
Subject: Re: [TypeScript] implemented treat warning as errors commandline option. (#966)

In src/compiler/diagnosticInformationMap.generated.ts:

@@ -364,6 +364,7 @@ module ts {

     Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: DiagnosticCategory.Message, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." },

     Watch_input_files: { code: 6005, category: DiagnosticCategory.Message, key: "Watch input files." },

     Redirect_output_structure_to_the_directory: { code: 6006, category: DiagnosticCategory.Message, key: "Redirect output structure to the directory." },
  •    Do_not_emit_JavaScript_on_error: { code: 6007, category: DiagnosticCategory.Message, key: "Do not emit JavaScript on error." },
    

I would change this to: "Do not emit outputs if any type checking errors were reported"


Reply to this email directly or view it on GitHubhttps://github.com//pull/966/files#r19442813.

Do_not_emit_comments_to_output: { code: 6009, category: DiagnosticCategory.Message, key: "Do not emit comments to output." },
Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" },
Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" },
Expand Down
4 changes: 4 additions & 0 deletions src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,10 @@
"category": "Message",
"code": 6006
},
"Do not emit JavaScript on error.": {
"category": "Message",
"code": 6007
},
"Do not emit comments to output.": {
"category": "Message",
"code": 6009
Expand Down
8 changes: 4 additions & 4 deletions src/compiler/tsc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,17 +362,17 @@ module ts {
var checker = program.getTypeChecker(/*fullTypeCheckMode*/ true);
var checkStart = new Date().getTime();
errors = checker.getDiagnostics();
if (!checker.hasEarlyErrors()) {
if (checker.hasEarlyErrors() || (compilerOptions.noEmitOnError && errors.length > 0)) {
exitStatus = EmitReturnStatus.AllOutputGenerationSkipped;
}
else {
var emitStart = new Date().getTime();
var emitOutput = checker.emitFiles();
var emitErrors = emitOutput.errors;
exitStatus = emitOutput.emitResultStatus;
var reportStart = new Date().getTime();
errors = concatenate(errors, emitErrors);
}
else {
exitStatus = EmitReturnStatus.AllOutputGenerationSkipped;
}
}

reportDiagnostics(errors);
Expand Down
1 change: 1 addition & 0 deletions src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,7 @@ module ts {
locale?: string;
mapRoot?: string;
module?: ModuleKind;
noEmitOnError?: boolean;
noErrorTruncation?: boolean;
noImplicitAny?: boolean;
noLib?: boolean;
Expand Down