Skip to content

Commit 54cd5cf

Browse files
committedAug 22, 2013
remove block indentation checks
- along with 8eab92b, fixes palantir#16
1 parent 5c1e88e commit 54cd5cf

File tree

6 files changed

+2
-55
lines changed

6 files changed

+2
-55
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Supported Rules
1515
* `eqeqeq` enforces === and !== in favor of == and !=.
1616
* `evil` disallows `eval` function invocations.
1717
* `forin` enforces a `for ... in` statement to be filtered with an `if` statement.*
18-
* `indent` enforces consistent indentation levels for the whole file.
18+
* `indent` enforces consistent indentation levels.
1919
* `labelpos` enforces labels only on sensible statements.
2020
* `label-undefined` checks that labels are defined before usage.
2121
* `maxlen` sets the maximum length of a line.

‎bin/tslint-cli.js

-6
Original file line numberDiff line numberDiff line change
@@ -27096,12 +27096,6 @@ var Lint;
2709627096
this.currentLevel = 0;
2709727097
this.tabWidth = tabWidth;
2709827098
}
27099-
IndentWalker.prototype.visitBlock = function (node) {
27100-
this.visitToken(node.openBraceToken);
27101-
this.checkAndVisitList(node.statements);
27102-
this.visitToken(node.closeBraceToken);
27103-
};
27104-
2710527099
IndentWalker.prototype.visitClassDeclaration = function (node) {
2710627100
this.currentLevel += 1;
2710727101
_super.prototype.visitClassDeclaration.call(this, node);

‎lib/tslint.js

-6
Original file line numberDiff line numberDiff line change
@@ -27096,12 +27096,6 @@ var Lint;
2709627096
this.currentLevel = 0;
2709727097
this.tabWidth = tabWidth;
2709827098
}
27099-
IndentWalker.prototype.visitBlock = function (node) {
27100-
this.visitToken(node.openBraceToken);
27101-
this.checkAndVisitList(node.statements);
27102-
this.visitToken(node.closeBraceToken);
27103-
};
27104-
2710527099
IndentWalker.prototype.visitClassDeclaration = function (node) {
2710627100
this.currentLevel += 1;
2710727101
_super.prototype.visitClassDeclaration.call(this, node);

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tslint",
3-
"version": "0.2.7",
3+
"version": "0.2.8",
44
"description": "a static analysis linter for TypeScript",
55
"bin": {
66
"tslint": "./bin/tslint"

‎src/rules/indentRule.ts

-7
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@ module Lint.Rules {
4949
this.tabWidth = tabWidth;
5050
}
5151

52-
// block indentation
53-
public visitBlock(node: TypeScript.BlockSyntax): void {
54-
this.visitToken(node.openBraceToken);
55-
this.checkAndVisitList(node.statements);
56-
this.visitToken(node.closeBraceToken);
57-
}
58-
5952
// class indentation
6053
public visitClassDeclaration(node: TypeScript.ClassDeclarationSyntax): void {
6154
this.currentLevel += 1;

‎test/rules/indentRuleTests.ts

-34
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ describe("<indent>", () => {
3333
Lint.Test.assertContainsFailure(actualFailures, expectedFailure);
3434
});
3535

36-
it("enforces function indentation", () => {
37-
var expectedFailure = Lint.Test.createFailure(fileName, [62, 4], [62, 19], failureString + "9");
38-
Lint.Test.assertContainsFailure(actualFailures, expectedFailure);
39-
});
40-
4136
it("enforces class variable indentation", () => {
4237
var expectedFailure = Lint.Test.createFailure(fileName, [66, 3], [66, 10], failureString + "2");
4338
Lint.Test.assertContainsFailure(actualFailures, expectedFailure);
@@ -67,18 +62,6 @@ describe("<indent>", () => {
6762
Lint.Test.assertContainsFailure(actualFailures, expectedFailure3);
6863
Lint.Test.assertContainsFailure(actualFailures, expectedFailure4);
6964
});
70-
71-
it("enforces block indentation", () => {
72-
var expectedFailure1 = Lint.Test.createFailure(fileName, [94, 3], [94, 9], failureString + "2");
73-
var expectedFailure2 = Lint.Test.createFailure(fileName, [98, 4], [98, 10], failureString + "6");
74-
var expectedFailure3 = Lint.Test.createFailure(fileName, [102, 3], [102, 9], failureString + "5");
75-
var expectedFailure4 = Lint.Test.createFailure(fileName, [106, 5], [106, 11], failureString + "7");
76-
77-
Lint.Test.assertContainsFailure(actualFailures, expectedFailure1);
78-
Lint.Test.assertContainsFailure(actualFailures, expectedFailure2);
79-
Lint.Test.assertContainsFailure(actualFailures, expectedFailure3);
80-
Lint.Test.assertContainsFailure(actualFailures, expectedFailure4);
81-
});
8265
});
8366

8467
describe("on a space-indented file", () => {
@@ -94,11 +77,6 @@ describe("<indent>", () => {
9477
Lint.Test.assertContainsFailure(actualFailures, expectedFailure);
9578
});
9679

97-
it("enforces function indentation", () => {
98-
var expectedFailure = Lint.Test.createFailure(fileName, [62, 10], [62, 25], failureString + "9");
99-
Lint.Test.assertContainsFailure(actualFailures, expectedFailure);
100-
});
101-
10280
it("enforces class variable indentation", () => {
10381
var expectedFailure = Lint.Test.createFailure(fileName, [66, 3], [66, 10], failureString + "2");
10482
Lint.Test.assertContainsFailure(actualFailures, expectedFailure);
@@ -128,17 +106,5 @@ describe("<indent>", () => {
128106
Lint.Test.assertContainsFailure(actualFailures, expectedFailure3);
129107
Lint.Test.assertContainsFailure(actualFailures, expectedFailure4);
130108
});
131-
132-
it("enforces block indentation", () => {
133-
var expectedFailure1 = Lint.Test.createFailure(fileName, [94, 3], [94, 9], failureString + "2");
134-
var expectedFailure2 = Lint.Test.createFailure(fileName, [98, 7], [98, 13], failureString + "6");
135-
var expectedFailure3 = Lint.Test.createFailure(fileName, [102, 6], [102, 12], failureString + "5");
136-
var expectedFailure4 = Lint.Test.createFailure(fileName, [106, 8], [106, 14], failureString + "7");
137-
138-
Lint.Test.assertContainsFailure(actualFailures, expectedFailure1);
139-
Lint.Test.assertContainsFailure(actualFailures, expectedFailure2);
140-
Lint.Test.assertContainsFailure(actualFailures, expectedFailure3);
141-
Lint.Test.assertContainsFailure(actualFailures, expectedFailure4);
142-
});
143109
});
144110
});

0 commit comments

Comments
 (0)
Please sign in to comment.