thepassle / barrel-begone

50 stars 1 forks source link

add `--fix` option #8

Open thepassle opened 5 months ago

thepassle commented 5 months ago

It would be cool to have a --fix option. If anything from your local project imports something from a barrel file, try to see if theres a package-exports allowed import for it and modify the import to that instead

Also not sure yet what tool we should use for this. Maybe we can get away with simple string replaces? I'd like to avoid babel because it handles new syntax poorly (see unpkg), and so the tool would get outdated quickly and becomes a bit of a maintenance burden. Maybe jscodeshift is good? Im not sure what that uses under the hood though.