Skip to content

Commit

Permalink
Allow empty commented lines.
Browse files Browse the repository at this point in the history
```stylus
// This sort of thing (empty line below
// with trailing-space trimmed)
//
// ...shouldn't trigger a warning. Mmmmkay?
```
  • Loading branch information
maranomynet committed Feb 26, 2016
1 parent 126cc0e commit 05664e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/checks/commentSpace.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

var commentRe = /\/\/ /


/**
* @description // check for space after line comment
* @returns {boolean} true if comment found, false if not
Expand All @@ -16,8 +15,9 @@ var commentSpace = function() {
if ( commentRe.test( this.cache.comment ) ) {
spaceAfterComment = true
}
var emptyComment = /\/\/$/.test( this.cache.comment )

if ( this.state.conf === 'always' && spaceAfterComment === false ) {
if ( this.state.conf === 'always' && spaceAfterComment === false && !emptyComment ) {
this.msg( 'line comments require a space after //' )
}
else if ( this.state.conf === 'never' && spaceAfterComment === true ) {
Expand Down

0 comments on commit 05664e4

Please sign in to comment.