Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Reasonable and intuitive line counting (proposed fix for #468) (#469)
Browse files Browse the repository at this point in the history
* Proposed fix for issue #468

* Revision of a test script responding to a fix of #468

* Avoid using tsutils v2.29.0, which breaks tests

* Revert "Avoid using tsutils v2.29.0, which breaks tests"

This reverts commit f1e963f.

See also: #469 (comment)
  • Loading branch information
makotom authored and Josh Goldberg committed Jul 25, 2018
1 parent ba235ad commit f4c6aae
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 162 deletions.
2 changes: 1 addition & 1 deletion src/maxFuncBodyLengthRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class MaxFunctionBodyLengthRuleWalker extends Lint.RuleWalker {
const sourceFile: ts.SourceFile = this.getSourceFile();
const startLine: number = sourceFile.getLineAndCharacterOfPosition(node.body.pos).line;
const endLine: number = sourceFile.getLineAndCharacterOfPosition(node.body.end).line;
return endLine - startLine;
return endLine - startLine + 1;
}

private calcBodyCommentLength(node: ts.FunctionLikeDeclaration) {
Expand Down
Loading

0 comments on commit f4c6aae

Please sign in to comment.