How to configure Eclipse to remove trailing spaces when saving a JavaScript file?

I am running Eclipse 3.6 (Helios 20110218-0911) on Ubuntu 11.04. In the "Preferences" section, I moved to the following panel:

JavaScript → Editor → Save Actions.

The "More Actions" checkbox is selected and "Delete trailing spaces in all lines" is selected.

enter image description here

However, when I save my JavaScript file in Eclipse, there is still a space at the end of my lines.

What am I missing?

+4
source share
3 answers

"Save Actions" for JavaScript is only available in a JavaScript project (a project with a JavaScript character).
(If you see "Convert to JavaScript project" in the "Customize" menu, when you right-click the project, try)

+5
source

You are looking here. How to automatically remove trailing spaces in Eclipse? or try to find similar topics?

This may be useful for you, I think :)

0
source

I recently ran into the same problem. The only way I found is to convert the project to a Javascript project. Right-click the project folder in Explorer, select [Customize] → [Convert to Javascript Project], and the Javascript Save Action will start.

Unfortunately, I do not know how to return it. Since this is not a big problem for me, the way to convert it to javascript really helps me.

0
source

All Articles