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 type checking #671

Closed
5 of 6 tasks
bisubus opened this issue Oct 29, 2024 · 1 comment
Closed
5 of 6 tasks

Support type checking #671

bisubus opened this issue Oct 29, 2024 · 1 comment
Labels
bug Something isn't working pending triage

Comments

@bisubus
Copy link

bisubus commented Oct 29, 2024

Acknowledgements

  • I read the documentation and searched existing issues to avoid duplicates
  • I understand this is a bug tracker and anything other than a proven bug will be closed
  • I understand this is a free project and relies on community contributions
  • I read and understood the Contribution guide

Minimal reproduction URL

https://github.com/bisubus/node-app-template/blob/39de183f651b02b917a02d5bd8ad9d5c433e8da1/package.json

Problem & expected behavior (under 200 words)

This is a feature request rather than a bug. I'm interested in collaborating on it

This has already been addressed with #121 but no proper reasoning was provided. The missing point is that tsx is advertised as a replacement for ts-node (which is abandoned) but provides no feature parity. ts-node provides type checks. The suggested tsc --noEmit workaround isn't convenient for regular run and cannot be effectively used for interactive and watch modes.

Here is an example of a possible workaround with watch mode:

  "scripts": {
    "check": "tsc --noEmit",
    "no-check:watch": "tsx watch --clear-screen=false --import=./env.ts src/index.ts",
    "watch": "run-p \"check -- --watch\" no-check:watch",
  },

The problem is that it cannot prevent a rebuild on type errors. Since tsx cli wasn't written to be extendable, this would require to fully discard watch feature and do this from scratch, e.g. with nodemon. And there is no workaround for interactive mode.

I assume the approach to optional type checking would be to rely on the existence of tsc without introducing typescript as a direct dependency, or import typescript optional dependency to process repl lines, both for global and local use

Bugs are expected to be fixed by those affected by it

  • I'm interested in working on this issue

Compensating engineering work will speed up resolution and support the project

  • I'm willing to offer $10 for financial support
@bisubus bisubus added bug Something isn't working pending triage labels Oct 29, 2024
@privatenumber
Copy link
Owner

Thanks for the issue but this is a bug tracker. Please file your feature request in the sponsors-only development repo.

@privatenumber privatenumber closed this as not planned Won't fix, can't repro, duplicate, stale Oct 29, 2024
Repository owner locked and limited conversation to collaborators Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working pending triage
Projects
None yet
Development

No branches or pull requests

2 participants