microsoft / microsoft/TypeScript
Unwanted auto-imports in script files
@andrewbranch ci sta già lavorando.
Dal 3/8/2023.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
Bug Report
I have a mixture of module and non-module code.
The problem occurs when I edit non-module files (tsconfig: "module": "none").
Sometimes when using auto-completion (in VisualStudio 2022) typescript finds a "matching" name from the module world and adds a line like
import { HmiHelper } from './helper/HmiHelper.js';
into the first line of my file.
But as the current file was configured as "module": "none" this import pushes typescript into modules mode and the current code is invalid.
🔎 Search Terms
intellisense
auto-import
modules
🕗 Version & Regression Information
This bug is many years old and persists in Typescript 5.1.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.