unimport
unimport copied to clipboard
fix: fix for loop local variable detection
Closes https://github.com/unjs/unimport/issues/487.
Generally, I was thinking that the regex solution feels very fragile. Parsing the file would probably the more stable solution, so there are probably more cases.
And we'd probably need a test and I'm not sure where to put it.
Could you help to add some tests for it? Thanks
I added one. Doesn't look too bad.