microsoft / microsoft/TypeScript

Provide a clear and explicit TypeScript pkg.types alternative, such as pkg.typescriptTypes

Aperta
#35,292 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Awaiting More Feedback Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

Search Terms

package.types, package.json types, types, typings, ts-types

Suggestion

It would be great if TS provided an additional alias for package.json's types/typings fields.

This new alias should make it clear it refers to TypeScript types, so that projects that provide more than one type system can avoid ambiguity.

A possible solution would be a new ts-types field.

Use Cases

See "Suggestion"

Examples

{
  "name": "my-library",
  "ts-types": "ts-types/index.d.ts"
}

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

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 esaminando come vengono attualmente interpretati i campi types e typings di package.json, insieme alla sezione Common Feature Requests delle FAQ. Definisci l'alias specifico per TypeScript proposto e la sua compatibilità con i metadati dei package esistenti; il lavoro sarà considerato completato quando saranno disponibili un design concordato e un'implementazione convalidata rispetto al comportamento di package-resolution.

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

Valutazione

Stack tecnologico
typescript
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.