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

extra empty line in import #26

Closed
vagusX opened this issue Dec 6, 2019 · 2 comments
Closed

extra empty line in import #26

vagusX opened this issue Dec 6, 2019 · 2 comments
Assignees

Comments

@vagusX
Copy link
Member

vagusX commented Dec 6, 2019

image

facebook/jscodeshift#249

按照这个 issue 所描述,空行不属于 AST 的部分,无法通过 AST 去移除

facebook/jscodeshift#185
benjamn/recast#405 (comment)
reactjs/react-codemod#103

按照 recast 、jscodeshift 和 react-codemod 的 issue 来看,这个额外空行的引入无法避免

@vagusX vagusX self-assigned this Dec 6, 2019
@vagusX vagusX changed the title remove extra empty line in import extra empty line in import Dec 6, 2019
@vagusX
Copy link
Member Author

vagusX commented Dec 6, 2019

换成 insertBefore 好了

@vagusX
Copy link
Member Author

vagusX commented Dec 6, 2019

换到行首在处理文件第一行评论的时候还是会有类似的问题

image

这种就无法避免了 😂

@vagusX vagusX closed this as completed Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant