Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS5094: Compiler option '--noEmit' may not be used with '--build' #55573

Closed
remcohaszing opened this issue Aug 30, 2023 · 3 comments
Closed

TS5094: Compiler option '--noEmit' may not be used with '--build' #55573

remcohaszing opened this issue Aug 30, 2023 · 3 comments

Comments

@remcohaszing
Copy link

🔎 Search Terms

TS5094
TS5094 noEmit build

🕗 Version & Regression Information

  • This is a crash

⏯ Playground Link

N/A, it’s a CLI bug

💻 Code

// An empty file will suffice, but let’s add a console.log to make more interesting.
console.log('hello')
// Now this is the interesting file
// tsconfig.json
{
  "compilerOptions": {
    "noEmit": true
  }
}

🙁 Actual behavior

This command behaves as tsc --noEmit

$ tsc --build

The --build and --noEmit options are mutually exclusive. I imagine --build is supposed to be mutually exclusive with the noEmit compiler option instead.

$ tsc --build --noEmit false
error TS5094: Compiler option '--noEmit' may not be used with '--build'.

🙂 Expected behavior

My preferred solution is that --build disables the noEmit compiler option.

Another option is that --build fails if noEmit is true.

Additional information about the issue

I think the tsc --build option is great. I prefer this over running tsc without it.

I also like the idea of running tsc without emitting anything. This is achieved by adding noEmit to tsconfig.json.

It’s unfortunate these two currently don’t play well together. As a workaround I now typically don’t use --build.

@fatcerberus
Copy link

Related to #53979. Apparently the two options aren't entirely mutually exclusive.

@fatcerberus
Copy link

This is a crash

This is not a crash.

@remcohaszing
Copy link
Author

I’m going to close this as a duplicate of #53979. Maybe that issue should add TS5094 to the search terms.

This is not a crash.

Not really, but it felt the most accurate one from the options the issue template gave me.

@remcohaszing remcohaszing closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants