mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Compiler flag to specify line ending #1693 code review adjustments
This commit is contained in:
parent
16d7e5cad7
commit
c1d2aeab84
@ -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
|
||||
|
||||
@ -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
|
||||
},
|
||||
|
||||
@ -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)),
|
||||
|
||||
@ -1691,9 +1691,8 @@ module ts {
|
||||
}
|
||||
|
||||
export const enum NewLineKind {
|
||||
DEFAULT = 0,
|
||||
CRLF = 1,
|
||||
LF = 2,
|
||||
CarriageReturnLineFeed = 0,
|
||||
LineFeed = 1,
|
||||
}
|
||||
|
||||
export interface LineAndCharacter {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user