Skip to content

Commit f2a7434

Browse files
authored
Merge pull request microsoft#12376 from Microsoft/vladima/update-tslint
update to tslint@next
2 parents 71b28a0 + eaf791e commit f2a7434

9 files changed

+20
-16
lines changed

scripts/parallel-lint.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1-
var Linter = require("tslint");
1+
var tslint = require("tslint");
22
var fs = require("fs");
33

44
function getLinterOptions() {
55
return {
6-
configuration: require("../tslint.json"),
76
formatter: "prose",
87
formattersDirectory: undefined,
98
rulesDirectory: "built/local/tslint"
109
};
1110
}
11+
function getLinterConfiguration() {
12+
return require("../tslint.json");
13+
}
1214

13-
function lintFileContents(options, path, contents) {
14-
var ll = new Linter(path, contents, options);
15-
return ll.lint();
15+
function lintFileContents(options, configuration, path, contents) {
16+
var ll = new tslint.Linter(options);
17+
ll.lint(path, contents, configuration);
18+
return ll.getResult();
1619
}
1720

18-
function lintFileAsync(options, path, cb) {
21+
function lintFileAsync(options, configuration, path, cb) {
1922
fs.readFile(path, "utf8", function (err, contents) {
2023
if (err) {
2124
return cb(err);
2225
}
23-
var result = lintFileContents(options, path, contents);
26+
var result = lintFileContents(options, configuration, path, contents);
2427
cb(undefined, result);
2528
});
2629
}
@@ -30,7 +33,8 @@ process.on("message", function (data) {
3033
case "file":
3134
var target = data.name;
3235
var lintOptions = getLinterOptions();
33-
lintFileAsync(lintOptions, target, function (err, result) {
36+
var lintConfiguration = getLinterConfiguration();
37+
lintFileAsync(lintOptions, lintConfiguration, target, function (err, result) {
3438
if (err) {
3539
process.send({ kind: "error", error: err.toString() });
3640
return;

scripts/tslint/booleanTriviaRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Lint from "tslint/lib/lint";
1+
import * as Lint from "tslint/lib";
22
import * as ts from "typescript";
33

44
export class Rule extends Lint.Rules.AbstractRule {

scripts/tslint/nextLineRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Lint from "tslint/lib/lint";
1+
import * as Lint from "tslint/lib";
22
import * as ts from "typescript";
33

44
const OPTION_CATCH = "check-catch";

scripts/tslint/noInOperatorRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Lint from "tslint/lib/lint";
1+
import * as Lint from "tslint/lib";
22
import * as ts from "typescript";
33

44

scripts/tslint/noIncrementDecrementRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Lint from "tslint/lib/lint";
1+
import * as Lint from "tslint/lib";
22
import * as ts from "typescript";
33

44

scripts/tslint/noTypeAssertionWhitespaceRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Lint from "tslint/lib/lint";
1+
import * as Lint from "tslint/lib";
22
import * as ts from "typescript";
33

44

scripts/tslint/objectLiteralSurroundingSpaceRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Lint from "tslint/lib/lint";
1+
import * as Lint from "tslint/lib";
22
import * as ts from "typescript";
33

44

scripts/tslint/preferConstRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Lint from "tslint/lib/lint";
1+
import * as Lint from "tslint/lib";
22
import * as ts from "typescript";
33

44
export class Rule extends Lint.Rules.AbstractRule {

scripts/tslint/typeOperatorSpacingRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Lint from "tslint/lib/lint";
1+
import * as Lint from "tslint/lib";
22
import * as ts from "typescript";
33

44

0 commit comments

Comments
 (0)