Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
50 lines (46 loc) · 1.57 KB

File metadata and controls

50 lines (46 loc) · 1.57 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var tslint = require("tslint");
var fs = require("fs");
var path = require("path");
function getLinterOptions() {
return {
formatter: "prose",
formattersDirectory: undefined,
rulesDirectory: "built/local/tslint"
};
}
function getLinterConfiguration() {
return tslint.Configuration.loadConfigurationFromPath(path.join(__dirname, "../tslint.json"));
}
function lintFileContents(options, configuration, path, contents) {
var ll = new tslint.Linter(options);
ll.lint(path, contents, configuration);
return ll.getResult();
}
function lintFileAsync(options, configuration, path, cb) {
fs.readFile(path, "utf8", function (err, contents) {
if (err) {
return cb(err);
}
var result = lintFileContents(options, configuration, path, contents);
cb(undefined, result);
});
}
process.on("message", function (data) {
switch (data.kind) {
case "file":
var target = data.name;
var lintOptions = getLinterOptions();
var lintConfiguration = getLinterConfiguration();
lintFileAsync(lintOptions, lintConfiguration, 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;
}
});
Morty Proxy This is a proxified and sanitized view of the page, visit original site.