-
Notifications
You must be signed in to change notification settings - Fork 887
Conversation
Moves all of `run`'s logic to a `runAsync` that uses async/await. This uses the `mz` package. I'm curious on your opinions on this: should TSLint do work to wrap the `fs` APIs in Promises, or take on the package as a dependency? Starts on #2328.
|
IIRC @JoshuaKGoldberg was the one who exported it, hence I guess it is used in the wild. I don't really see a benefit in just using Promises but then awaiting them all of the time. As it is now there will only be overhead with nothing gained. |
Interesting. How would you prefer the runner logic be written?
The idea behind separating out
Agreed! #2182 - since nobody's responded, I think I can send a quick separate PR for this soon.
Even as a prerequisite for #2328? |
I wasn't commenting on the way it was implemented but on the way it is exposed. You wouldn't do e.g. |
I'm not sure I agree with the idea of using plain functions over a class for the runner logic. Right now it has two objects that are used,
Is option 1 maintainable? Option 2 is made simpler by using 3 instead. |
If you find that everything in your program needs to have access to everything else, the solution isn't to put it all in one class! It can be broken down into simple components that don't all need to access each other. See #2572. |
Sure. I'd love to discuss this further but your PR looks better :) |
Thanks! |
I'll send a new PR when yours is in. |
Moves all of
run
's logic to arunAsPromise
that uses async/await.This uses the
mz
package. I'm curious on your opinions on this: should TSLint do work to wrap thefs
APIs in Promises, or take on the package as a dependency?Starts on #2328.