You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

tslint-lines-between-class-members

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tslint-lines-between-class-members - npm Package Compare versions

Comparing version

to
1.2.4

test/fixtures/fails/noLineAndCommentAboveClass.ts

2

linesBetweenClassMembersRule.js

@@ -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 @@