microsoft / microsoft/TypeScript

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

Offen
#58,684 2 Kommentare 1 Reaktion 1 zugewiesene Person Auf GitHub ansehen

@sheetalkamat arbeitet bereits daran.

Seit 18.6.2024.

Needs Investigation
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.4k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

🔍 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,

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.