microsoft / microsoft/TypeScript

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

Open
#52,655 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.