microsoft / microsoft/TypeScript
Boolean CLI options in standard "--someFlag=someValue" form fail with "error TS5023: Unknown compiler option..."
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.4k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported TS5023 errors for --incremental=false and --noEmit=false, then trace the compiler's command-line option parsing. Compare those forms with the existing boolean-option behavior and verify that --flag=value is accepted with the expected value, including the examples in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100