Skip to content

Commit

Permalink
Merge pull request #186 from golmansax/master
Browse files Browse the repository at this point in the history
Brackets on always shouldn't fail if line is empty
  • Loading branch information
Ross committed Aug 22, 2015
2 parents a5b5e11 + e9e3b90 commit 5b10dbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/checks/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var brackets = function( line ) {
// 3 mixin
// 4 .selector,
if ( this.state.hashOrCSS ||
line.trim().length === 0 ||
line.indexOf( ' =' ) !== -1 ||
parensRe.test( line ) ||
commaRe.test( line ) ) {
Expand Down
3 changes: 3 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,9 @@ describe('Linter Style Checks: ', function() {
assert.equal( undefined, bracketsTest('{foo() + "bar"}') )
assert.equal( undefined, bracketsTest('$foo = {') )
})
it('undefined if empty', function() {
assert.equal( undefined, bracketsTest(' ') )
})
})

describe('brackets: disallow brackets', function() {
Expand Down

0 comments on commit 5b10dbd

Please sign in to comment.