microsoft / microsoft/TypeScript
Function type definition with anonymous arguments and optional parentheses for single argument
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
Suggestion
🔍 Search Terms
anonymous type argument, optional parentheses
List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily and help provide feedback.
✅ Viability 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, new syntax sugar for JS, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
⭐ Suggestion
Like a anonymous function and anonymous type, it could be nice a type definition with anonymous arguments. Also, as in function definition, function type definition with single argument, the parentheses could be optional.
📃 Motivating Example
This simple enhancement let a more clean and lean code syntaxe.
💻 Use Cases
// currently
function f(callback:(...args: string[]) => void) { ... }
// anonymous arguments
function f(callback: (...string[]) => void) { ... }
// anonymous argument + optional parentheses
function f(callback: ...string[] => void) { ... }
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.
Direzione di ricerca
L’issue non identifica alcun file di implementazione, punto di ingresso o test; inizia dai suoi esempi motivanti e dalle forme sintattiche richieste. Il lavoro sarà completato quando le forme per argomenti anonimi e parentesi opzionali saranno accettate come descritto, senza modificare il JavaScript emesso, e sarà aggiunta la copertura di regressione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 32/100