microsoft / microsoft/TypeScript

Playground typing issue

Aperta
#63,334 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Website
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

### 🔎 Search Terms

TypeScript Playground error when attempting to import something from `@octokit/core/types`

### 🕗 Version & Regression Information

Seems irrelavent to TS version

### ⏯ Playground Link

https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAKjgQwM5wPIGMYQNbAwAqAnmAKboBmUEIcA5AAIQ76ED0W05HMZlBgCghoSLDgBvTGwLwAvnBp1GrXHIYBuEdwB2qeAHNCACwCuAIzgBeOLvIB3GesIAKAJTah5AB7j4egbO7MQCqF6+-nD8FMFypLG2MeQQVHDGMOYW2kA

### 💻 Code

```ts
import * as OctokitTypes from '@octokit/core/types';
```

### 🙁 Actual behavior

**Behavior 1**:

Type of the following variable is recognized as `any`:
```ts
import { Octokit } from 'octokit';
export type T = typeof Octokit;
```

**Behavior 2**:

Type of the following variable is recognized as `any`;
```ts
import * as OctokitTypes from '@octokit/core/types';
export const OctokitTypes;
```

**Behavior 3**: _Even stranger behavior_

In the following code snippet:
```ts
import * as OctokitTypes from '@octokit/core/types';
```

1. Remove any character from package name `@octokit/core/types` (e.g. `@octokit/core/type`), TS error occured, which is expected
Image
2. Re-add the removed character, TS error remained, which is very weird
Image
Apparently there is some problem with the language server, as the package name has been changed to `*/types`, but it still reports error of `*/type`

### 🙂 Expected behavior

N/A

### Additional information about the issue

_No response_

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo i tre comportamenti nel TypeScript Playground collegato, concentrandoti sull’import di @octokit/core/types e sulla diagnostica obsoleta dopo la modifica del nome del pacchetto. Traccia il comportamento rilevante della risoluzione dei moduli o del language server; il lavoro è completato quando l’import valido viene risolto con i suoi tipi effettivi e la diagnostica viene aggiornata dopo la modifica.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
compilers
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.