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
54export 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}
0 commit comments