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

Commit

Permalink
fixup linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hzoo committed Apr 13, 2016
1 parent f3e70db commit 85b2f28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lib/rules/require-padding-newlines-after-blocks.js
Expand Up @@ -169,7 +169,8 @@ module.exports.prototype = {
this.exceptions.SingleLine = true;
} else {
assert(false, optionName + ' option requires "allExcept" to only have ' +
'one of "inCallExpressions", "inNewExpressions", "inArrayExpressions", "inProperties" or "singleLine"');
'one of "inCallExpressions", "inNewExpressions",' +
'"inArrayExpressions", "inProperties" or "singleLine"');
}
}, this);
} else {
Expand Down Expand Up @@ -209,7 +210,7 @@ module.exports.prototype = {
var tokens = {
next: endToken.getNextCodeToken(),
token: endToken
}
};

if (isException(node, parentElement, this.exceptions)) {
return;
Expand Down
8 changes: 5 additions & 3 deletions test/specs/rules/require-padding-newlines-after-blocks.js
Expand Up @@ -267,11 +267,13 @@ describe('rules/require-padding-newlines-after-blocks', function() {
});

it('should not report missing padding when block is a single line', function() {
expect(checker.checkString('var i = 0;\nwhile (i < 100) {\nif(i % 2 === 0) {continue;}\n++i;\n}')).to.have.no.errors();
var str = 'var i = 0;\nwhile (i < 100) {\nif(i % 2 === 0) {continue;}\n++i;\n}';
expect(checker.checkString(str)).to.have.no.errors();
});

it('should not report missing padding when block is a single line nested in another single line block', function() {
expect(checker.checkString('var i = 0;\nwhile (i < 100) {\nif(i % 2 === 0) {if(i === 4) {continue;}}\n++i;\n}')).to.have.no.errors();
it('should not report missing padding when block is a single line that is nested', function() {
var str = 'var i = 0;\nwhile (i < 100) {\nif(i % 2 === 0) {if(i === 4) {continue;}}\n++i;\n}';
expect(checker.checkString(str)).to.have.no.errors();
});
});

Expand Down

0 comments on commit 85b2f28

Please sign in to comment.