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

Support running tsc --noEmit before transpiling #121

Closed
aminya opened this issue Oct 19, 2022 · 1 comment
Closed

Support running tsc --noEmit before transpiling #121

aminya opened this issue Oct 19, 2022 · 1 comment
Labels

Comments

@aminya
Copy link

aminya commented Oct 19, 2022

Feature request

It would be nice to add an option so that tsx runs tsc --noEmit before transpiling

Why?

Type-checking is important, and only relying on the IDE checker is not enough. The dependencies of a project change, and those can introduce new type errors. But because I haven't opened that file, the IDE doesn't check it.

Alternatives

Wrapping tsx so that it calls tsc --noEmit file before tsx

Additional context

No response

@aminya aminya added enhancement New feature or request pending triage labels Oct 19, 2022
@privatenumber
Copy link
Owner

Blocking execution with type-checking kind of defeats the point of tsx. If you want to do that, why not just run tsc and use Node to run the compiled file?

Also, you can run this yourself:

tsc --noEmit ./file.ts && tsx ./file.ts

Or wrap it in a package.json script.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants