Microsoft/TypeScript

Do not rename imports from ambient modules

Open

#8 227 ouverte le 20 avr. 2016

Voir sur GitHub
 (6 commentaires) (3 réactions) (0 assignés)TypeScript (6 726 forks)batch import
Effort: ModerateHelp WantedSuggestion

Métriques du dépôt

Stars
 (48 455 stars)
Métriques de merge PR
 (Merge moyen 6j 17h) (9 PRs mergées en 30 j)

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.

Guide contributeur