editorconfig icon indicating copy to clipboard operation
editorconfig copied to clipboard

trim_trailing_whitespaces should ignore comments

Open FezVrasta opened this issue 7 years ago • 4 comments

I'm writing some JSDoc comments and I noticed that editorconfig doesn't make any distinction between code and comments.

The problem here is that JSDoc makes use of the Markdown convention of 2 trailing whitespaces to be interpreted as newline.

Is this a flaw in the editorconfig specification or of the editor plugin I'm using?

FezVrasta avatar Apr 23 '17 10:04 FezVrasta

Unfortunately that would be too specific. I wonder whether it is possible to implement this as editor plugins.

xuhdev avatar Apr 23 '17 22:04 xuhdev

Markdown also lets you end a line with \ to force a linebreak, which is less likely to get mangled in general.

felix9 avatar Oct 12 '17 21:10 felix9

Usually the settings made in editorconfig files are simply mapped to existing settings of editors. Editorconfig is not about implementing the underlying functions (Yes, I know, there are plugins that implement some of them itself).

If you have a project, which needs trailing spaces somewhere, say for markdown, your solution is to set trim_trailing_whitespaces to off to make sure all of you project members use the right setting. This will turn the trimming off for code, too. But that's the least common denominator supported by all editors.

hgraeber avatar Oct 13 '17 21:10 hgraeber

necrobumping this here since I have the same problem with Sassdoc, what did you end up doing @FezVrasta?

Eduruiz avatar Feb 18 '22 21:02 Eduruiz