WebStorm 2018.1.4 not removing trailing spaces

Hi!

There is a problem with WebStorm stripping of trailing spaces on JavaScript files (.js or .jsx). With other file types the feature works normally. Changing the Languages & Frameworks > JavaScript > JavaScript language version setting doesn't make a difference (usually I use Flow).

I've tried with all settings of Editor > General > Strip trailing spaces on Save. Also tried enabling and disabling Always keep trailing spaces on caret line.

In IntelliJ the feature works normally with the same JavaScript files and about the same settings.

 

Thanks!

Aapeli Haanpuu

6 comments

Do you have .editorconfig in your project? if yes, what does it look like?

0

No Elena, there's no .editorconfig in the project

0

weird.. Can you try disabling editorconfig support in Preferencess | Editor | Code Style by unchecking Enable Editorconfig support checkbox to be on the safe side?

>In IntelliJ the feature works normally with the same JavaScript files and about the same settings.

Both IDEA and Webstorm are built from same sources, so they should work equally here. These are your settings that might differ... do you use any custom plugins/external watchers that may touch your .js files? Is the issue specific to certain project (create a new empty project, add .js file - does the issue persist)?

0

Thank you Elena! I tested all of those and also a bit more and finally found that I had the option Editor > Code Style > JavaScript > Tabs and Indents > Keep indents on empty lines selected, and after deselecting it everything works again. I didn't think that there'd be some other setting, that overrides that Strip trailing spaces on Save setting.

But yes, problem is now solved. Thanks for help!

3

Great, thanks for clearing it up!

0

Hey - thanks for this - been trying to hunt this one down off and on for ages!!

0

Please sign in to leave a comment.