Reuse existing import if already defined in the file
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- babel, typescript
- Domain
- tooling
Research direction
Start by locating the TypeScript import-move codemod logic that rewrites source and destination imports. Reproduce the example using the existing project test or codemod entry point, then verify that the moved specifier is merged into the existing destination import rather than emitted as a duplicate.
Written by the indexing model from the issue text.
Description
If we move from let say packlets/utils to @acme/utils and in the file, there is already a @acme/utils imports we should add imports to it and do not create a new one.
So from:
import { fn1 } from 'packlets/utils'
import { fn2 } from '@acme/utils'
To:
import { fn2, fn1 } from '@acme/utils'
Currently it will generate following:
import { fn1 } from '@acme/utils'
import { fn2 } from '@acme/utils'
- Dominant language
- TypeScript
- Stars
- 13
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·