Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upTrailing spaces inside a multi-line string #482
Comments
This comment has been minimized.
This comment has been minimized.
|
Reported this to ESLint: eslint/eslint#5786 |
feross
added
bug
blocked
labels
Apr 4, 2016
This comment has been minimized.
This comment has been minimized.
|
Hmm, I don't know though, many people uses editors that trim trailing whitespace and I think that it might just be a very idea to force the author of the code to solve it in another way up front, rather than having the code break later when someone saves the file in e.g. Atom. If you really need trailing whitespace in the string you could write it as follows. let str = [
'',
a,
' ',
b,
''
].join('\n') |
This comment has been minimized.
This comment has been minimized.
|
Yeah, I sort of agree with you @LinusU. |
This comment has been minimized.
This comment has been minimized.
|
Actually I agree, automatic trimming of trailing whitespace is common and will just cause problems later. |
This comment has been minimized.
This comment has been minimized.
|
Okay, going to close this since it's reported to ESLint and they'll do with it what they will at this point. |
simonratner commentedApr 4, 2016
The following triggers an error:
Current workaround is to surround the block with
/* eslint-disable no-trailing-space */, but it would be better if whitespace inside strings was ignored for the purposes of this check.