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
Issues with changes not detected immediately after ts-morph exits #755
Comments
This is probably my fault. I’ve been meaning to update the docs. Are you awaiting the result of calling Side note: probably don’t use |
yes, that sounds like that's the problem. Is there a callback I can use to be informed when it's finished? |
@Roaders it returns a promise so you should be able to do |
ok, thanks. I'll give that a try. |
@Roaders please reopen this if it's still an issue. |
Describe the bug
It seems that writing of source files happens after ts-morph has exited (and after subsequent tasks run).
Version: 5.0.0
A migration script that runs
ts-morph
to replace imports then immediately runstslint --fix
to reorder imports does not successfully reorder the imports. If I run the script a second time the out of place imports are correctly picked up by tslint and are fixed.I am wondering if the actual writing of the source files is happening after ts-morph exits.
I am kind of expecting the response to be no you're crazy this can't happen but at the moment I can't see anything else that explains what I am seeing...
If I add a 2 second delay between ts-morph finishing and lint starting it DOES work correctly.
The text was updated successfully, but these errors were encountered: