Skip to content

Commit

Permalink
Fix noempty bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gscshoyru committed Feb 11, 2014
1 parent 30d9ee2 commit d33ba76
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/rules/noEmptyRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class Rule extends Lint.Rules.AbstractRule {

class BlockWalker extends Lint.RuleWalker {
private ignoredBlocks: TypeScript.BlockSyntax[] = [];

public visitBlock(node: TypeScript.BlockSyntax): void {
var hasCommentAfter = node.openBraceToken.trailingTrivia().hasComment();
var hasCommentBefore = node.closeBraceToken.leadingTrivia().hasComment();
Expand All @@ -43,9 +43,8 @@ class BlockWalker extends Lint.RuleWalker {

public visitConstructorDeclaration(node: TypeScript.ConstructorDeclarationSyntax): void {
var isSkipped = false;

for (var i = 0; i < node.parameterList.parameters.childCount(); i++) {
var param = <TypeScript.ParameterSyntax>node.parameterList.parameters.childAt(i);
for (var i = 0; i < node.parameterList.parameters.nonSeparatorCount(); i++) {
var param = <TypeScript.ParameterSyntax>node.parameterList.parameters.nonSeparatorAt(i);

for (var j = 0; j < param.modifiers.childCount(); j++) {
var modifier = param.modifiers.childAt(j).kind();
Expand Down
2 changes: 1 addition & 1 deletion test/files/rules/noempty.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ for (var y = 0; y < 1; ++y) {
}

class testClass {
constructor(private allowed: any) {
constructor(private allowed: any, private alsoAllowed: any) {
}
}

Expand Down
2 changes: 1 addition & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"no-debugger": true,
"no-duplicate-key": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-empty": false,
"no-eval": true,
"no-string-literal": true,
"no-trailing-comma": false,
Expand Down

0 comments on commit d33ba76

Please sign in to comment.