tslint-eslint-rules
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -45,6 +45,6 @@ "use strict"; | ||
var body = this.nearestBody(node); | ||
var isValid = (body.kind === ts.SyntaxKind.SourceFile && body.distance === 1) || body.distance === 2; | ||
var isValid = (body.isSourceFile && body.distance === 1) || body.distance === 2; | ||
if (!isValid) { | ||
var decl = node.kind === ts.SyntaxKind.FunctionDeclaration ? 'function' : 'variable'; | ||
var root = body.kind === ts.SyntaxKind.SourceFile ? 'program' : 'function body'; | ||
var root = body.isSourceFile ? 'program' : 'function body'; | ||
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "move " + decl + " declaration to " + root + " root")); | ||
@@ -61,3 +61,3 @@ } | ||
return { | ||
kind: ancestor.kind, | ||
isSourceFile: (ancestor && ancestor.kind === ts.SyntaxKind.SourceFile) || !ancestor, | ||
distance: generation | ||
@@ -64,0 +64,0 @@ }; |
{ | ||
"name": "tslint-eslint-rules", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Improve your TSLint with the missing ESLint Rules", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
150463
26
1463