Trailing whitespaces in Eclipse

Let the world know ...Tweet about this on TwitterShare on Google+0Share on Facebook0Email this to someoneShare on LinkedIn0

SonarQube is not only good in telling you that you have a tab indentation problem, but also shows that you have a lot of white spaces that make no sense: trailing white spaces at the end of a line.

How do you get rid of these in Eclipse?

You can configure Eclipse to delete trailing white spaces when you save the file.

Go to Windows -> Preferences -> Javascript -> Editor -> Save Actions

Activate “Perform the selected actions on save” and then “Additional actions” and select “Configure‚Ķ

Switch to tab “Code Organizing

Confirm your choices by clicking OK. Afterwards the additional actions sections contains your selected save actions:

Every time you now click on save in a Javascript file, these actions will be executed.

Let the world know ...Tweet about this on TwitterShare on Google+0Share on Facebook0Email this to someoneShare on LinkedIn0

Leave a Reply

Your email address will not be published. Required fields are marked *