Skip to content

Commit

Permalink
Merge pull request #115 from vegansk/114-default-eol
Browse files Browse the repository at this point in the history
Use host EOL by default, fixes #114
  • Loading branch information
vvakame authored Oct 27, 2017
2 parents 35c6b6a + 1c210fe commit 9021fc6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import * as tsconfigjson from "./provider/tsconfigjson";
import * as editorconfig from "./provider/editorconfig";
import * as tslintjson from "./provider/tslintjson";
import * as vscodesettings from "./provider/vscodesettings";
import { EOL } from "os";

const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, "../package.json")).toString());
export const version = packageJson.version;
Expand Down Expand Up @@ -163,7 +164,7 @@ export function processString(fileName: string, content: string, opts: Options):
}
processor.addPostProcess((_fileName: string, formattedCode: string, _opts: Options, formatSettings: ts.FormatCodeSettings) => {
// replace newline code. maybe NewLineCharacter params affect to only "new" newline by language service.
formattedCode = formattedCode.replace(/\r?\n/g, formatSettings.newLineCharacter || "\n");
formattedCode = formattedCode.replace(/\r?\n/g, formatSettings.newLineCharacter || EOL);
return Promise.resolve(formattedCode);
});

Expand Down

0 comments on commit 9021fc6

Please sign in to comment.