-
Notifications
You must be signed in to change notification settings - Fork 63
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
Restore eslint rule for no-unused-vars #2078
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2078 +/- ##
==========================================
+ Coverage 61.38% 61.40% +0.02%
==========================================
Files 479 479
Lines 22912 22909 -3
Branches 5250 5365 +115
==========================================
+ Hits 14064 14068 +4
+ Misses 8573 8559 -14
- Partials 275 282 +7
Continue to review full report at Codecov.
|
b1df5d5
to
abe05fb
Compare
abe05fb
to
3ad872a
Compare
I noticed this the other day, too, and I didn't have time to complete a fix, but I did find a configuration for this eslint rule that I thought might be useful. It's: "@typescript-eslint/no-unused-vars": [
"warn",
{
"ignoreRestSiblings": true,
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
], Basically it allows unused vars/args if they have a "_" prefix, which can be useful when you want to indicate a name for what is being ignored. It also doesn't warn on unused rest siblings, which can be useful for "ignoring" parts of an object. See these changes in this branch: https://github.com/GMOD/jbrowse-components/tree/add_no_unused_vars_gs |
Interesting. Do you have any ideas for this issue? We could switch to using strict "import type" instead of plain import I think to fix this, but that would be a lot of lines of code changed https://github.com/GMOD/jbrowse-components/pull/2078/checks?check_run_id=2933281474#step:5:1160 Alternatively, we could...maybe consider using the normal no-unused-vars instead of @typescript-eslint/no-unused-vars |
Feel free to merge that branch into here if interested too |
It's really weird that the lint output from the build doesn't match that of just running eslint, but I am able to reproduce it locally. I'm not sure |
I'm not sure why the linting that happens as part of the webpack build isn't working correctly, but there is actually an option to disable that step of the build. I don't think we gain anything by linting during the build, since we lint everything separately anyway, so I've disabled it in my branch and everything works. Merging that branch in here now. |
thanks so much @garrettjstevens for helping to debug the issues with this PR.. expert level eslint engineering! |
The eslint rule for unused vars got disabled at some point. This re-enables it and fixes some of the related errors