Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit ce34c05

Browse files
committed
requireNewlineBeforeSingleStatementsInIf: make lint happy
1 parent f9f203b commit ce34c05

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

lib/rules/require-newline-before-single-statements-in-if.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,12 @@ module.exports.prototype = {
6363

6464
function assertDifferentLine(token, nextToken) {
6565
errors.assert.differentLine({
66-
token: token,
67-
nextToken: nextToken,
68-
message: 'Newline before single statement in if is required'
66+
token: token,
67+
nextToken: nextToken,
68+
message: 'Newline before single statement in if is required'
6969
});
7070
}
7171

72-
// Recursively locate a token based on it's type.
73-
function getToken(entity, tokenType, tokenProperty) {
74-
if (entity.type === tokenType || !entity[tokenProperty]) {
75-
return entity;
76-
}
77-
78-
return getToken(entity[tokenProperty], tokenType, tokenProperty);
79-
}
80-
8172
file.iterateNodesByType('IfStatement', function(node) {
8273
var token;
8374
var consequentNode = node.consequent;

0 commit comments

Comments
 (0)