Skip to content
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

insertAfter adds empty line before #185

Open
ghost opened this issue Feb 20, 2017 · 7 comments
Open

insertAfter adds empty line before #185

ghost opened this issue Feb 20, 2017 · 7 comments
Labels

Comments

@ghost
Copy link

ghost commented Feb 20, 2017

insertAfter adds new line before inserted ast.

I created second import by jscodeshift so in js it looks like

//Core
import React, { Component, PropTypes } from 'react';

import connect from 'react-redux';

But should be:

import React, { Component, PropTypes } from 'react';
import connect from 'react-redux';
@fkling
Copy link
Contributor

fkling commented Feb 21, 2017

Thanks for reporting this! jscodeshift doesn't do any of the printing, recast does. Please file an issue or PR there.

@ghost
Copy link
Author

ghost commented Feb 22, 2017

@fkling Thx. I've been doing it already.

@alexlafroscia
Copy link

For anyone else that comes across this, the accompanying recast issue can be found here:

benjamn/recast#371

@ghost
Copy link

ghost commented May 30, 2019

Also for anyone looking for a fix for running codemods: run this script afterwards to remove the empty lines: https://gist.github.com/jackaldridge/68b39a8e1de71384b8caaeb78ee10cda

@alloy
Copy link

alloy commented Jul 18, 2019

@JackAldridge Excellent, thanks 🙌

@shogunsea
Copy link

#185 (comment) Works like a charm

@yungsters
Copy link
Contributor

benjamn/recast#371 has been closed without a resolution for 2 years. It isn't clear to me that there is an actionable next step for jscodeshift here, so we should probably close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants