Closed steveschmitt closed 6 years ago
I'm gad that you found this tool useful!
I'll look into it. It does look quite greedy to use result.match(/\bimport\b/)
for something this trivial. Just need to remember why it was added in the first place...
@steveschmitt Any chance you can provide an example of a file that causes the exception? I added a bunch of "import" words in change b500d31 but it wasn't enough to see the issue.
Closing due to inactivity + unable to reproduce
The
optimizeImports
function is too sensitive to the word "import" in function.ts, line 101. If the code containsThen it throws "optimizeImports() could not deal with the following..."
I hacked my local copy to just do
console.warn
instead of throwing an error. Maybe that's acceptable, unless you have a more robust approach.P.S. Thanks for this tool.