-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'tsserverVS-WIP' of https://github.com/Microsoft/TypeScript
- Loading branch information
Showing
438 changed files
with
14,502 additions
and
31,082 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
var Linter = require("tslint"); | ||
var fs = require("fs"); | ||
|
||
function getLinterOptions() { | ||
return { | ||
configuration: require("../tslint.json"), | ||
formatter: "prose", | ||
formattersDirectory: undefined, | ||
rulesDirectory: "built/local/tslint" | ||
}; | ||
} | ||
|
||
function lintFileContents(options, path, contents) { | ||
var ll = new Linter(path, contents, options); | ||
return ll.lint(); | ||
} | ||
|
||
function lintFileAsync(options, path, cb) { | ||
fs.readFile(path, "utf8", function (err, contents) { | ||
if (err) { | ||
return cb(err); | ||
} | ||
var result = lintFileContents(options, path, contents); | ||
cb(undefined, result); | ||
}); | ||
} | ||
|
||
process.on("message", function (data) { | ||
switch (data.kind) { | ||
case "file": | ||
var target = data.name; | ||
var lintOptions = getLinterOptions(); | ||
lintFileAsync(lintOptions, target, function (err, result) { | ||
if (err) { | ||
process.send({ kind: "error", error: err.toString() }); | ||
return; | ||
} | ||
process.send({ kind: "result", failures: result.failureCount, output: result.output }); | ||
}); | ||
break; | ||
case "close": | ||
process.exit(0); | ||
break; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.