tslint-lines-between-class-members
Advanced tools
Comparing version
@@ -88,3 +88,3 @@ "use strict"; | ||
}) - 1; | ||
return sourceFile.getText().substring(lineStartPositions[startPosIdx - 1], lineStartPositions[startPosIdx] - 1); | ||
return sourceFile.text.substring(lineStartPositions[startPosIdx - 1], lineStartPositions[startPosIdx] - 1); | ||
}; | ||
@@ -91,0 +91,0 @@ LinesBetweenClassMembersWalker.prototype.onRuleLintFail = function (node) { |
{ | ||
"name": "tslint-lines-between-class-members", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Custom rule for TSLint to enforce blank lines between class methods - achieves a similar thing to lines-between-class-members in ESLint", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -34,2 +34,7 @@ import test, {AssertContext} from 'ava'; | ||
test('fails when no new line and a comment above the class', (t: AssertContext) => { | ||
const results = TestHelpers.lint('fails/noLineAndCommentAboveClass.ts'); | ||
t.is(results.errorCount, 1); | ||
}); | ||
test('passes when empty new line between class methods', (t: AssertContext) => { | ||
@@ -64,1 +69,6 @@ const results = TestHelpers.lint('passes/emptyNewLine.ts'); | ||
}); | ||
test('does not fail when there is a comment above class', (t: AssertContext) => { | ||
const results = TestHelpers.lint('passes/commentAboveClass.ts'); | ||
t.is(results.errorCount, 0); | ||
}); |
@@ -83,3 +83,3 @@ import * as Lint from 'tslint'; | ||
return sourceFile.getText().substring(lineStartPositions[startPosIdx - 1], lineStartPositions[startPosIdx] - 1); | ||
return sourceFile.text.substring(lineStartPositions[startPosIdx - 1], lineStartPositions[startPosIdx] - 1); | ||
} | ||
@@ -86,0 +86,0 @@ |
116725
0.45%27
8%496
3.55%