microsoft / microsoft/TypeScript
Do not rename imports from ambient modules
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
Issue explained by @bbgone in https://github.com/Microsoft/TypeScript/issues/8118#issuecomment-212218038
Renaming an import alias for a module coming from a .d.ts file, renames all instances. this is obviously wrong.
Options, 1. error (obviously not helpful), 2. only rename local symbol (better, but leaves the code in an invalid state), 3. rename local import and add as oldname clause to the import declaration as needed (looks like the best solution).
This is similar to the issue related to https://github.com/Microsoft/TypeScript/issues/7458, except that this issue adds renaming the import alias.
Contributor guide
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.
Research direction
Start by reading the discussion in issue #8118 and compare the related issue #7458 to understand ambient-module import aliases and the rename behavior. Trace the import-alias rename entry point in the TypeScript language-service code and its tests, if present. Done means renaming the local alias preserves valid imports without renaming symbols supplied by the .d.ts module.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100