@fimbul/wotan
Advanced tools
Comparing version 0.21.0-dev.20190424 to 0.21.0-dev.20190505
{ | ||
"name": "@fimbul/wotan", | ||
"version": "0.21.0-dev.20190424", | ||
"version": "0.21.0-dev.20190505", | ||
"description": "Pluggable TypeScript and JavaScript linter", | ||
@@ -5,0 +5,0 @@ "bin": "bin/main.js", |
@@ -24,4 +24,6 @@ "use strict"; | ||
this.fileContent = new Map(); | ||
this.getCanonicalFileName = ts.sys.useCaseSensitiveFileNames ? (f) => f : (f) => f.toLowerCase(); | ||
this.moduleResolutionCache = ts.createModuleResolutionCache(this.cwd, this.getCanonicalFileName); | ||
this.compilerOptions = {}; | ||
this.getDefaultLibFileName = ts.getDefaultLibFilePath; | ||
this.getCanonicalFileName = ts.sys.useCaseSensitiveFileNames ? (f) => f : (f) => f.toLowerCase(); | ||
this.realpath = this.fs.realpath === undefined ? undefined : (fileName) => this.fs.realpath(fileName); | ||
@@ -154,3 +156,3 @@ } | ||
getNewLine() { | ||
return '\n'; | ||
return this.compilerOptions.newLine === ts.NewLineKind.CarriageReturnLineFeed ? '\r\n' : '\n'; | ||
} | ||
@@ -182,2 +184,4 @@ safeRealpath(f) { | ||
createProgram(rootNames, options, oldProgram, projectReferences) { | ||
this.compilerOptions = options; | ||
this.moduleResolutionCache = ts.createModuleResolutionCache(this.cwd, this.getCanonicalFileName, options); | ||
return ts.createProgram({ rootNames, options, oldProgram, projectReferences, host: this }); | ||
@@ -189,3 +193,9 @@ } | ||
updateProgram(program) { | ||
return this.createProgram(program.getRootFileNames(), program.getCompilerOptions(), program, program.getProjectReferences()); | ||
return ts.createProgram({ | ||
rootNames: program.getRootFileNames(), | ||
options: program.getCompilerOptions(), | ||
oldProgram: program, | ||
projectReferences: program.getProjectReferences(), | ||
host: this, | ||
}); | ||
} | ||
@@ -201,2 +211,7 @@ onReleaseOldSourceFile(sourceFile) { | ||
} | ||
resolveModuleNames(names, file, _, reference) { | ||
const seen = new Map(); | ||
const resolve = (name) => ts.resolveModuleName(name, file, this.compilerOptions, this, this.moduleResolutionCache, reference).resolvedModule; | ||
return names.map((name) => utils_1.resolveCachedResult(seen, name, resolve)); | ||
} | ||
} | ||
@@ -203,0 +218,0 @@ tslib_1.__decorate([ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
331715
4115