-
-
Notifications
You must be signed in to change notification settings - Fork 79
Stripping of newlines in comments when preceded by carriage returns #145
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
Comments
Thank you for this issue! It looks like a bug to me. I think we need to replace those CRLF with LF. |
Thanks! If possible, though, I think it might be more ideal for us if you could preserve them so that when fixing comments for people, our parser remains aware of the original line endings. |
The comments are kind of an exception to the Abstract part of the AST acronym (Abstract Syntax Tree), so I think it makes sense there to retain the full exact formatting data. |
Thank you for your opinion. |
Hi,
Our users for
eslint-plugin-jsdoc
have reported problems with Vue in passing on preserving newlines within the ESLint ASTcomments
property when carriage returns are also present (preceding them).I've confirmed that
@babel/eslint-parser
does not strip the newlines when interpreting the text within the user's<script>
tag, but when supplying the text tovue-eslint-parser
, though the carriage returns our preserved, the newlines are stripped, producing comment AST like the following, causing our plugin to report errors when there should be none:However, I see that in the likes of
templateBody
AST, at least, instead of newlines being missing, the newlines are present (and the carriage returns are not added), as perhaps is expected. But forcomments
, there is the above problem.Code to reproduce (in a
type: "module"
package):The text was updated successfully, but these errors were encountered: