-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for no-unused-modules to handle the export { default } from syntax #1640
Fix for no-unused-modules to handle the export { default } from syntax #1640
Conversation
3 similar comments
Test looks good; looking forward to the fix :-) |
I have a fix, but I'm not sure if it's correct or complete. What bothers me is that I was struggling to get the tests passed until I realized that running my test in isolation would work, but running it with the other tests would cause it to fail. I don't currently really understand how the I also had to modify the one other test that I identified as interacting with my own test. This is the one where we basically have a copy of One general suggestion I have about the code within |
Hi @ljharb, I was wondering if you had the chance to take a look at this. I'm also up for refactoring or improving code comments/documentation of this plugin so that it is easier for future contributors to make changes to. |
Is there any update on this PR? This issue is blocking our team from using this eslint rule. |
I think this is ready for review. Let me update the PR title to indicate that it's more than just a failing test case, since there's a fix included as well, and that it's not WIP (at least from my perspective). |
826c39f
to
66a6a43
Compare
I did a bit of cleaning up here including:
@ljharb, please let me know if there's anything else I can do here. Also, feel free to make any changes you want directly to this branch, since I've checked the "Allow edits from maintainers." box on this PR. |
What is blocking this change? This would help out our team immensely! Great job on this @richardxia 😄! |
66a6a43
to
efd6be1
Compare
Thanks for merging this in, and I'm excited to use this lint rule on my codebase soon! |
@ljharb -- is it possible to make a release of the plugin? My team would really appreciate this fix :-) |
Relates to #1631.
At the moment, I only have a failing test case, since it took me a while to understand how imports and exports worked with the testing system. If my current understanding is correct, the
filename
property refers to the file that this test "replaces", and thecode
property is the text contents of the replacement.The way I've proven to myself that this demonstrates the bug is that if I replace the contents of the
code
property withthen the test passes. The
export { default } from './file-o'
syntax should be equivalent to the above, so if we get that test passing, then the bug should be fixed.I'm going to make an attempt at understanding the
ExportMap
code enough to try to fix the bug, but I've checked the "Allow edits from maintainers" box on this PR, so feel free to push up commits to this.