Compiler flag to specify line ending #1693 code review adjustments

This commit is contained in:
kmashint 2015-04-26 21:32:51 -04:00
parent 16d7e5cad7
commit c1d2aeab84
4 changed files with 9 additions and 7 deletions

View File

@ -68,7 +68,7 @@ module ts {
},
{
name: "newLine",
type: { "crlf": NewLineKind.CRLF, "lf": NewLineKind.LF },
type: { "crlf": NewLineKind.CarriageReturnLineFeed, "lf": NewLineKind.LineFeed },
description: Diagnostics.Emit_newline_Colon_CRLF_dos_or_LF_unix,
paramType: Diagnostics.NEWLINE,
error: Diagnostics.Argument_for_newLine_option_must_be_CRLF_or_LF

View File

@ -2006,7 +2006,7 @@
"category": "Message",
"code": 6062
},
"Argument for --newLine option must be 'CRLF' or 'LF'.": {
"Argument for 'newLine' option must be 'CRLF' or 'LF'.": {
"category": "Error",
"code": 6063
},

View File

@ -91,8 +91,11 @@ module ts {
}
}
let newLine = [sys.newLine, "\r\n", "\n"][options.newLine ? Number(options.newLine) : 0];
let newLine =
options.newLine === NewLineKind.CarriageReturnLineFeed ? "\r\n" :
options.newLine === NewLineKind.LineFeed ? "\n" :
sys.newLine;
return {
getSourceFile,
getDefaultLibFileName: options => combinePaths(getDirectoryPath(normalizePath(sys.getExecutingFilePath())), getDefaultLibFileName(options)),

View File

@ -1691,9 +1691,8 @@ module ts {
}
export const enum NewLineKind {
DEFAULT = 0,
CRLF = 1,
LF = 2,
CarriageReturnLineFeed = 0,
LineFeed = 1,
}
export interface LineAndCharacter {