microsoft / microsoft/TypeScript

[isolatedDeclarations] Should imported JSON files be emitted when "resolveJsonModules", "emitDeclarationOnly", and "isolatedDeclarations" are all enabled?

Aperta
#58,684 2 commenti 1 reazione 1 assegnatario Vedi su GitHub

@sheetalkamat ci sta già lavorando.

Dal 18/6/2024.

Needs Investigation
Lingua principale
Go
Stelle
111k
Fork
14.4k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

🔍 Search Terms

json, resolvejsonmodules, isolateddeclarations, emit, declarations, import, emitDeclarationOnly

✅ Viability Checklist
⭐ Suggestion

Emit/transpile JSON files when the aforementioned compile options are enabled

📃 Motivating Example

The primary purpose of isolated declarations is to be able to emit declarations for a project without needing to typecheck it and one of the main motivators for that is being able to start typechecking downstream projects, e.g. in a composite build, without waiting for typecheck.

It might be fair to say then that it would be good for downstream projects to be able to start typechecking without waiting for their dependees to transpile code. Even with isolated declarations, this is not possible at the moment, because types may depend on JSON files when resolveJsonModules is enabled, and JSON files are only emitted/copied when JS transpilation is enabled, i.e. "emitDeclarationOnly": false.

💻 Use Cases

Being able to typecheck a composite project in parallel where sub-projects are configured with

    "isolatedDeclarations": true,
    "emitDeclarationOnly": true,
    "resolveJsonModule": true,

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.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.