dprint-plugin-typescript
dprint-plugin-typescript copied to clipboard
Potential Bug: Formatting hangs while formatting file.
Hey folks,
Did not know how to classify this since I can't guarantee it's a bug.
As I was trying to format the following js code:
https://cdn.shopify.com/shopifycloud/shopify/assets/checkout_2021-01-25-ca23aa375cfbe97f7ea054a0e4816dc8adc01895e1301ccd89148d508f60df5e.js
The formatting never completed even after waiting for 30 minutes for the process to end. The same file can be beautified in the browser in a couple of seconds.
The code right now is not optimized for formatting minified files. It seems to take a long time in the playground too, so not a wasmer issue.
Would be good if I implemented https://github.com/dprint/dprint/issues/263 to catch these more easily, but yeah there should be something done here to make this faster. I'll investigate this later.
Thanks @dsherret, really appreciate that.
Hi, is the issue is resolved? Or there is workaround for minified js file? Thank you very much.
@aancw no, not yet. dprint-plugin-typescript is not very good at minified files at the moment and it would require maybe a day of investigation and work to fix it. I recommend excluding these files for now.
@dsherret Noted. Thank you for your dedication in this lib :)