JoshuaKGoldberg / TypeStat

Converts JavaScript to TypeScript and TypeScript to better TypeScript. 🧫
MIT License
2.07k stars 39 forks source link

Feature to set max waves for run #1426

Open rubiesonthesky opened 8 months ago

rubiesonthesky commented 8 months ago

πŸš€ Feature Request

I'm trying to check if typestat could help enabling strict Typescript for my project. Currently it's messing up every file really weird way. For debugging this, I think it would be nice to be able to say that typestat should only do 10 waves and then complete.

I tried to read all the documentation but I did not spot this kind of setting.

Existing Behavior

Tool will just run infinitely (probably).

Change Proposal

Add cli flag or option in the config file, where user could set maximum waves that will be run.

rubiesonthesky commented 8 months ago

This is off topic for this feature request, but typestat is currently doing this kind of changes

-import {SearchApiService} from '../services/search-api.service';
+import {SearchApiService} from '../service | List<T>s/search-api.service';
JoshuaKGoldberg commented 8 months ago

This is off topic for this feature request, but typestat is currently doing this kind of changes

-import {SearchApiService} from '../services/search-api.service';
+import {SearchApiService} from '../service | List<T>s/search-api.service';

Yup that would be a good separate bug issue to file please 😁

JoshuaKGoldberg commented 8 months ago

Tool will just run infinitely (probably).

There should be detection of infinite waves (#1055 -> #1056). If you have a case where that detection isn't kicking in, do you think you could post a repro please?

The concept of "waves" is pretty implementation-detail-y, to the point where I don't think it's ideal to expose it to users. Ideally the tool would detect any bad cases & automatically bail out instead. So if we can figure out a fix to auto-detection logic in your case, that'd be nice.

rubiesonthesky commented 8 months ago

For me the problem was not really that it would be infinite run. I did not let it run so long. But the fixed it was doing were incorrect and it started to throwing a lot errors.

So I think what you are saying about bailing out, would make more sense for my case I think.

JoshuaKGoldberg commented 8 months ago

Can you post the project / a way for me to reproduce this?

rubiesonthesky commented 8 months ago

@JoshuaKGoldberg I’ll try to check some details later. It’s a private repository so I can’t share it. But I'll test it again and I'll open bug report.

It may be possible that I can screen share or something with you, if this is reproductive. :)

JoshuaKGoldberg commented 7 months ago

Adding status: in discussion per #1491. Some good points there around making commits...