trailing whitespace on empty lines does not trigger rule #39

echorink opened this Issue Jul 24, 2012 · 6 comments


None yet

6 participants


having whitespace on an empty line does not trigger the trailing-whitespace rule, even though leading whitespace might exist due to autoindenters... might be nice to have a separate rule for this corner case?

    # blahblah
    # next line contains trailing whitespace (really, though markdown strips it!)


was expecting it to trigger "Line 3 contains trailing whitespace"

brysgo commented Aug 20, 2012

I suppose if other linters check empty lines for trailing whitespace we should be consistent. This is the regex we currently use:

    trailingWhitespace : /[^\s]+[\t ]+\r?$/

So, this was the original behaviour, but other folks didn't like that, so it was changed in #9. Maybe it's worth an option in the no_trailing_whitespace config?

brysgo commented Sep 22, 2012

I think it would be good to have.

thomasf commented Nov 7, 2012

i really agree

dnephin commented Oct 16, 2013

+1, I would like this as well

@AsaAyers AsaAyers closed this in f5259f2 Oct 20, 2013
vaiwa commented Aug 26, 2015

Please add parameter 'allowed_in_empty_lines' to the documentation at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment