Skip to content Skip to sidebar Skip to footer

Configuring Sublimelinter To Ignore Trailing Whitespace

When I use SublimeLinter for Sublime Text 2 with javascript it shows the red exclamation icon whenever there is a trailing whitespace, which shouldn't be a problem with javascript.

Solution 1:

You're looking in the wrong place - PEP8 is for Python code checking. SublimeLinter by default uses JSHint to lint JavaScript files. In this case, you can use this SublimeLinter config to silence the JavaScript trailing whitespace warnings:

{"jshint_options":{"trailing":false}}

See JSHint Options#trailing


But honestly, this is not the ideal way to go. Trailing whitespace is pure evil. Why, you may ask? Well a couple reasons off the top of my head:

Hence, I'd suggest trimming trailing whitespace automatically. In ST2, go to Preferences -> Settings - User and add this config:

{"trim_trailing_white_space_on_save":true}

This way, the trailing whitespaces are automatically removed upon the first Ctrl/Cmd+S, and not just for JavaScript, but any language you code in.

Post a Comment for "Configuring Sublimelinter To Ignore Trailing Whitespace"