Skip to content

Commit ebc8b68

Browse files
DanPurdybgriffith
authored andcommitted
🐛 fix check for double semicolons
1 parent d4aa99d commit ebc8b68

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/rules/trailing-semicolon.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
var hasDoubleSemiColon = function (tree) {
1414

1515
tree.traverseByType('declarationDelimiter', function (node, index, parent) {
16-
if (parent.content[index + 1].is('declarationDelimiter')) {
16+
if (parent.content[index + 1] && parent.content[index + 1].is('declarationDelimiter')) {
1717
result = helpers.addUnique(result, {
1818
'ruleId': parser.rule.name,
1919
'severity': parser.severity,
@@ -68,11 +68,11 @@ module.exports = {
6868
});
6969
}
7070
}
71-
hasDoubleSemiColon(parent);
7271
}
7372
}
7473
}
7574
}
75+
hasDoubleSemiColon(parent);
7676
});
7777
});
7878
}

tests/rules/trailing-semicolon.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('trailing semicolon - scss', function () {
1212
lint.test(file, {
1313
'trailing-semicolon': 1
1414
}, function (data) {
15-
lint.assert.equal(8, data.warningCount);
15+
lint.assert.equal(9, data.warningCount);
1616
done();
1717
});
1818
});
@@ -26,7 +26,7 @@ describe('trailing semicolon - scss', function () {
2626
}
2727
]
2828
}, function (data) {
29-
lint.assert.equal(4, data.warningCount);
29+
lint.assert.equal(5, data.warningCount);
3030
done();
3131
});
3232
});

0 commit comments

Comments
 (0)