Skip to content

Commit

Permalink
Merge pull request #998 from royaldark/develop
Browse files Browse the repository at this point in the history
Don't ignore comments in no-empty-rulesets
  • Loading branch information
DanPurdy committed Aug 27, 2017
2 parents b5aebda + 84796df commit 2c4f63e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/rules/no-empty-rulesets.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ module.exports = {
else {
block.traverse(function (item) {
if (!helpers.isEqual(block, item)) {
if (item.type !== 'space') {
if (item.type !== 'space' &&
item.type !== 'singlelineComment' &&
item.type !== 'multilineComment') {
nonSpaceCount++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/no-empty-rulesets.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('no empty rulesets - scss', function () {
lint.test(file, {
'no-empty-rulesets': 1
}, function (data) {
lint.assert.equal(3, data.warningCount);
lint.assert.equal(4, data.warningCount);
done();
});
});
Expand Down
7 changes: 7 additions & 0 deletions tests/sass/no-empty-rulesets.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@
}

.bar{}

.baz {
// a comment
/* and
yet
another */
}

0 comments on commit 2c4f63e

Please sign in to comment.