microsoft / microsoft/TypeScript

Boolean CLI options in standard "--someFlag=someValue" form fail with "error TS5023: Unknown compiler option..."

Aperta
#52,655 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

Bug Report

tl;dr: User's expect to assign CLI flag options with an equal sign. E.g.--flag=value. That this fails in tsc with an unobvious error is confusing. It misleads users into thinking there isn't a way of disabling options from the command line. For example:

Even if you wanted to forgo the speed benefits of "incremental"... you can't turn it off temporarily because there is no --noIncremental (or analogous) flag.

The form above is wide-spread, especially within the JS community ...

🔎 Search Terms

error TS5023: Unknown compiler option

🕗 Version & Regression Information

Boolean CLI options were first introduced in #11798 , but have never supported the standard --flag=value format

  • This is a crash
  • This changed between versions ______ and _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______
🙁 Actual behavior

Providing boolean CLI options like --incremental=false, --noEmit=false, and so on all result in a TS5023: Unknown compiler option error.

🙂 Expected behavior

Using the standard double-dash notation of "--flagName=flagValue" (.e.g --incremental=false) should work as expected.

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 gli errori TS5023 segnalati per --incremental=false e --noEmit=false, quindi segui l'analisi delle opzioni della riga di comando del compilatore. Confronta queste forme con il comportamento esistente delle opzioni booleane e verifica che --flag=value venga accettato con il valore previsto, inclusi gli esempi nell'issue.

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

Valutazione

Stack tecnologico
typescript
Ambito
cli, compilers
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.