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

tsc-strict doesn't work with --watch flag #79

Open
jandreola opened this issue Jun 11, 2024 · 2 comments
Open

tsc-strict doesn't work with --watch flag #79

jandreola opened this issue Jun 11, 2024 · 2 comments

Comments

@jandreola
Copy link

Documentation mentions that all tsc flags are supported by tsc-strict. But when I try to run tsc-strict with --watch I get the command stuck on ⠏ Looking for strict files....

Running the command in non watch mode works correctly. And the IDE also show errors correctly.

Any ideas if that is some sort of limitation of tsc-strict command?

I'm using typescript-strict-plugin@2.4.4 and typescript@5.4.5

@KostkaBrukowa
Copy link
Collaborator

Yes, tsc-strict wasn't designed to work with --watch in mind and it wont work. It basically runs tsc twice, one time with strict flag and compares the outputs after tsc ends, and if you run with --watch flag the output will never be collected because tsc will never end

@heyimalex
Copy link
Contributor

You could potentially create a PR to add this. There is an example of an incremental program watcher inside of the typescript docs, and you'd just filter out errors coming from strict files.

Here's what I rigged up, though it's not directly usable because it uses internal tools, maybe a good starting place. The strictify command is just generating a tsconfig.strict.json which is a copy of the base tsconfig.json but with strict enabled. There's definitely a way to handle that programatically.

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

3 participants