-
Notifications
You must be signed in to change notification settings - Fork 482
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
Newlines stripped from processed files #28
Comments
Hmm maybe this fixes it, benjamn/recast#199 |
Mmh, have to look at the recast thing, but also have a look at #27. |
@cpojer: I know, I was just wondering what recast did about this since it was mentioned there as well. |
So, the issue seems to be with using Babel as parser. If esprima is used, trailing and leading whitespace is preserved. I'd suggest we first look into if we can fix this in recast before making changes to jscodeshift. edit: nvm, it works also when I use babel-core as parser... now I'm confused... |
OK, I know what the issue is. Maybe everything will just work if we use the |
There have been multiple reports about the printed source missing trailing line breaks. The reason for the line break missing is that this information is contained in the `File` node, which is returned by `recast.parse`. However, because we build a node collection from the `Program` node instead of the `File` node, we are loosing this information. Using the `File` node fixes the issue and doesn't seem to break any existing functionality.
Awesome! Thanks @fkling |
Release in v0.3.3 btw. |
Add support for ES6 classes in sort-comp
It looks like this is an issue again in v0.4.0. Edit: Tested the same script with v0.3.32, newlines are preserved as expected. |
Aha, ran into this issue as well. I can confirm that downgrading to v0.3.32 fixes the issue. |
new lines seem to be removed even if i dont change a file, for now i am having to do:
Maybe this is an issue with
recast
?The text was updated successfully, but these errors were encountered: