Skip to content

Commit

Permalink
fix: we are not writing files, use normalized EOL
Browse files Browse the repository at this point in the history
  • Loading branch information
huafu committed Aug 19, 2018
1 parent cea9cc8 commit 47fff43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/lib/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

import { relative, basename, extname, join } from 'path'
import { readFileSync, writeFileSync } from 'fs'
import { EOL } from 'os'
import mkdirp = require('mkdirp')
import bufferFrom from 'buffer-from'
import stableStringify = require('fast-json-stable-stringify')
Expand Down Expand Up @@ -160,7 +159,7 @@ export function createCompiler(configs: ConfigSet): TsCompiler {
readDirectory: wrapWithDebug('readDirectory', ts.sys.readDirectory),
getDirectories: wrapWithDebug('getDirectories', ts.sys.getDirectories),
directoryExists: wrapWithDebug('directoryExists', ts.sys.directoryExists),
getNewLine: () => EOL,
getNewLine: () => '\n',
getCurrentDirectory: () => cwd,
getCompilationSettings: () => compilerOptions,
getDefaultLibFileName: () => ts.getDefaultLibFilePath(compilerOptions),
Expand Down
3 changes: 1 addition & 2 deletions src/lib/config-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
FormatDiagnosticsHost,
ParsedCommandLine,
} from 'typescript'
import { EOL } from 'os'
import { TSError } from './ts-error'
import { sha1 } from './sha1'
import { stringify } from './json'
Expand Down Expand Up @@ -354,7 +353,7 @@ export class ConfigSet {
: this.compilerModule.formatDiagnostics

const diagnosticHost: FormatDiagnosticsHost = {
getNewLine: () => EOL,
getNewLine: () => '\n',
getCurrentDirectory: () => this.cwd,
getCanonicalFileName: path => path,
}
Expand Down

0 comments on commit 47fff43

Please sign in to comment.