unimport icon indicating copy to clipboard operation
unimport copied to clipboard

fix: fix for loop local variable detection

Open dword-design opened this issue 2 months ago • 2 comments

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.

dword-design avatar Dec 16 '25 01:12 dword-design

Could you help to add some tests for it? Thanks

antfu avatar Dec 16 '25 01:12 antfu

I added one. Doesn't look too bad.

dword-design avatar Dec 16 '25 17:12 dword-design