-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spaced-comment
warns on "don't minify" comment blocks
#2777
spaced-comment
warns on "don't minify" comment blocks
#2777
Comments
You can use
|
aha, thanks! Sorry I missed that in my reading :-) However, I tried adding |
after further looking into this, I dont think there is an clean way to get rid of the error. |
Personally I wouldn't want to allow: /*blah
*blah
*/ but that might be pretty specific. If this only covered single-line comments I still think it'd be useful. |
To solve your case, you have to do what you just specified above. as of now. |
Then for now I'll have to leave the rule disabled :-( thanks for the quick replies |
Found the problem. As of now if you use a |
I didn't use a marker though, I created an exception. At any rate, I'd assume any syntactically valid whitespace would be allowed, so definitely that would include a newline, and possibly other chars (still getting confirmation on that tho) |
Valid whitespace is http://people.mozilla.org/~jorendorff/es6-draft.html#sec-white-space, so I'd think we'd want to include all of those? |
I think this is an edge case introduced when the logic for single line comments was added to multi-line comments. We should definitely allow any whitespace between lines, and we should also split milti-line comments on newline and treat each line individually. As for this issue, @ljharb do you have any whitespace after the |
As you can see on https://github.com/es-shims/es7-shim/blob/master/es7-shim.js#L1-L5, no, no trailing whitespace, just EOL. |
I just ran into this issue with this comment block: /**
* This is a block comment
*/ Neither /** This is a block comment */ Newline should be treated as valid whitespace in this case. |
thats what i proposed above and i agree. |
Fix: Allow blocked comments with markers and new-line (fixes #2777)
Typically, the first comment block in a file starts with
/*!
to indicate to a minifier like uglify that it should not strip the comment block (a "prelude").Could we add an option to the
spaced-comment
rule that allows this pattern?The text was updated successfully, but these errors were encountered: