benjamn / benjamn/recast

It duplicates a comment

Open
#700 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.3k
Forks
363
Avg merge
3d 8h
Merged PRs (30d)
3

Description

I discovered this when using flowts, which runs `babel-plugin-flow-to-typescript` through recast.
https://github.com/zxbodya/flowts/issues/10

The babel plugin splits up this import statement into a regular import and a `type` import, and deletes the comment.

Recast retains the comment, and puts it before both lines.

This isn't terrible, but it's interesting.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the linked flowts case involving babel-plugin-flow-to-typescript, recast, and a commented import statement. Trace recast's comment handling around the split import and compare the output with the input; done means the transformation no longer produces the reported duplicated or misplaced comment.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.