Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
Fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adidahiya committed Jul 14, 2016
1 parent f052b6a commit c74afed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export function runTest(testDirectory: string, rulesDirectory?: string | string[
getCanonicalFileName: (filename: string) => filename,
getCurrentDirectory: () => "",
getDefaultLibFileName: () => ts.getDefaultLibFileName(compilerOptions),
getDirectories: () => [],
getNewLine: () => "\n",
getSourceFile: function (filenameToGet: string) {
if (filenameToGet === this.getDefaultLibFileName()) {
Expand Down
11 changes: 9 additions & 2 deletions src/tslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ class Linter {
}

const {config} = ts.readConfigFile(configFile, ts.sys.readFile);
const parsed = ts.parseJsonConfigFileContent(config, {readDirectory: ts.sys.readDirectory}, projectDirectory);
const parsed = ts.parseJsonConfigFileContent(config, {
fileExists: (path: string) => true,
readDirectory: ts.sys.readDirectory,
useCaseSensitiveFileNames: false,
}, projectDirectory);
const host = ts.createCompilerHost(parsed.options, true);
const program = ts.createProgram(parsed.fileNames, parsed.options, host);

Expand All @@ -74,7 +78,10 @@ class Linter {
return program.getSourceFiles().map(s => s.fileName).filter(l => l.substr(-5) !== ".d.ts");
}

constructor(private fileName: string, private source: string, options: ILinterOptionsRaw, private program?: ts.Program) {
constructor(private fileName: string,
private source: string,
options: ILinterOptionsRaw,
private program?: ts.Program) {
this.options = this.computeFullOptions(options);
}

Expand Down

0 comments on commit c74afed

Please sign in to comment.