Skip to content

Commit

Permalink
Brackets on always shouldn't fail if line is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
golmansax committed Aug 19, 2015
1 parent 4bee5bc commit e9e3b90
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 e9e3b90

Please sign in to comment.