Skip to content

Commit 117da7f

Browse files
committed
Merge pull request microsoft#5622 from weswigham/tslint@next
Use tslint@next for linting
2 parents d2d2213 + ee10ea1 commit 117da7f

6 files changed

Lines changed: 17 additions & 17 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"browserify": "latest",
3636
"istanbul": "latest",
3737
"mocha-fivemat-progress-reporter": "latest",
38-
"tslint": "latest",
38+
"tslint": "next",
39+
"typescript": "next",
3940
"tsd": "latest"
4041
},
4142
"scripts": {

scripts/tslint/booleanTriviaRule.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
/// <reference path="../../node_modules/tslint/typings/typescriptServices.d.ts" />
2-
/// <reference path="../../node_modules/tslint/lib/tslint.d.ts" />
3-
1+
import * as Lint from "tslint/lib/lint";
2+
import * as ts from "typescript";
43

54
export class Rule extends Lint.Rules.AbstractRule {
65
public static FAILURE_STRING_FACTORY = (name: string, currently: string) => `Tag boolean argument as '${name}' (currently '${currently}')`;
@@ -19,7 +18,7 @@ class BooleanTriviaWalker extends Lint.RuleWalker {
1918

2019
visitCallExpression(node: ts.CallExpression) {
2120
super.visitCallExpression(node);
22-
if (node.arguments) {
21+
if (node.arguments) {
2322
const targetCallSignature = this.checker.getResolvedSignature(node);
2423
if (!!targetCallSignature) {
2524
const targetParameters = targetCallSignature.getParameters();
@@ -37,14 +36,14 @@ class BooleanTriviaWalker extends Lint.RuleWalker {
3736
let triviaContent: string;
3837
const ranges = ts.getLeadingCommentRanges(arg.getFullText(), 0);
3938
if (ranges && ranges.length === 1 && ranges[0].kind === ts.SyntaxKind.MultiLineCommentTrivia) {
40-
triviaContent = arg.getFullText().slice(ranges[0].pos + 2, ranges[0].end - 2); //+/-2 to remove /**/
39+
triviaContent = arg.getFullText().slice(ranges[0].pos + 2, ranges[0].end - 2); // +/-2 to remove /**/
4140
}
4241
if (triviaContent !== param.getName()) {
4342
this.addFailure(this.createFailure(arg.getStart(source), arg.getWidth(source), Rule.FAILURE_STRING_FACTORY(param.getName(), triviaContent)));
4443
}
4544
}
4645
}
4746
}
48-
}
47+
}
4948
}
5049
}

scripts/tslint/nextLineRule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/// <reference path="../../node_modules/tslint/typings/typescriptServices.d.ts" />
2-
/// <reference path="../../node_modules/tslint/lib/tslint.d.ts" />
1+
import * as Lint from "tslint/lib/lint";
2+
import * as ts from "typescript";
33

44
const OPTION_CATCH = "check-catch";
55
const OPTION_ELSE = "check-else";

scripts/tslint/noNullRule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/// <reference path="../../node_modules/tslint/typings/typescriptServices.d.ts" />
2-
/// <reference path="../../node_modules/tslint/lib/tslint.d.ts" />
1+
import * as Lint from "tslint/lib/lint";
2+
import * as ts from "typescript";
33

44

55
export class Rule extends Lint.Rules.AbstractRule {

scripts/tslint/preferConstRule.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/// <reference path="../../node_modules/tslint/typings/typescriptServices.d.ts" />
2-
/// <reference path="../../node_modules/tslint/lib/tslint.d.ts" />
1+
import * as Lint from "tslint/lib/lint";
2+
import * as ts from "typescript";
33

44

55
export class Rule extends Lint.Rules.AbstractRule {
@@ -101,13 +101,13 @@ class PreferConstWalker extends Lint.RuleWalker {
101101
this.visitBindingLiteralExpression(node as (ts.ArrayLiteralExpression | ts.ObjectLiteralExpression));
102102
}
103103
}
104-
104+
105105
private visitBindingLiteralExpression(node: ts.ArrayLiteralExpression | ts.ObjectLiteralExpression) {
106106
if (node.kind === ts.SyntaxKind.ObjectLiteralExpression) {
107107
const pattern = node as ts.ObjectLiteralExpression;
108108
for (const element of pattern.properties) {
109109
if (element.name.kind === ts.SyntaxKind.Identifier) {
110-
this.markAssignment(element.name as ts.Identifier)
110+
this.markAssignment(element.name as ts.Identifier);
111111
}
112112
else if (isBindingPattern(element.name)) {
113113
this.visitBindingPatternIdentifiers(element.name as ts.BindingPattern);

scripts/tslint/typeOperatorSpacingRule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/// <reference path="../../node_modules/tslint/typings/typescriptServices.d.ts" />
2-
/// <reference path="../../node_modules/tslint/lib/tslint.d.ts" />
1+
import * as Lint from "tslint/lib/lint";
2+
import * as ts from "typescript";
33

44

55
export class Rule extends Lint.Rules.AbstractRule {

0 commit comments

Comments
 (0)