-
Notifications
You must be signed in to change notification settings - Fork 70
Feature request: --fix mode to automatically remove unused exports #23
Comments
False positives are not a huge issue as the changes can be reviewed using version control, and the incorrect removals can easily be reverted, and also TypeScript type-checking will let us know if we removed something that's actually still used somewhere. But I can understand if this is a non-goal, especially at this point. 👍 |
Just to clarify @nadeesha, is this a non-goal because it is a larger undertaking than you personally want to invest in, or is it truly something you think should not be within scope for this project? The real question being, would you accept an outside contribution which added this feature? I think @emlai is correct that there is relatively low risk in such a feature even in the presence of false positives, due to type checking + version control. It would be a huge time saver if instead of having to go through hundreds of exports and remove them by hand, the task was to restore a handful of erroneously removed exports until everything compiled. |
Not saying I have time to do this either at the moment, but I didn't want potential contributors to see this issue and be discouraged from making a PR unless you were really against it 🙂 |
I'll accept a PR for this - if done correctly. However, due to the limitations of the APIs, we're only heuristically matching certain use cases. Therefore, I'm not sure we can ever have a exhaustive list and cover all of the scenarios to make sure a Another option would be to implement a
But that's a much bigger undertaking. I'm open to anyone jumping on this thread, or opening a new one if there's enough interest. Closing for now. |
I didn't see this issue when I implemented it, but there's a working implementation in #67. Putting this here so it's cross-linked. It doesn't fulfill all the above mentioned properties, but it's still useful enough. |
No description provided.
The text was updated successfully, but these errors were encountered: