-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): [no-unused-vars] support explicit resource management with ignoreUsingDeclarations
option
#11456
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR, @nayounsang! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
View your CI Pipeline Execution ↗ for commit afa9b92
☁️ Nx Cloud last updated this comment at |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11456 +/- ##
=======================================
Coverage 90.88% 90.88%
=======================================
Files 505 505
Lines 51121 51137 +16
Branches 8413 8419 +6
=======================================
+ Hits 46459 46475 +16
Misses 4648 4648
Partials 14 14
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just requesting a bit of alignment with eslint/eslint#19828
Thanks!
@@ -546,6 +557,12 @@ export default createRule<Options, MessageIds>({ | |||
}); | |||
} | |||
continue; | |||
} else if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprised this isn't caught by a lint rule, but we shouldn't have else if
after the unconditional continue
(along the lines of no-else-return).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on lint option(allowElseIf:false), conditional statement is separated into single if.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, could you make sure that the tests equivalent to https://github.com/eslint/eslint/pull/19828/files#diff-a011296b092c66311bc2ef19de30721cb1c5e9164be696f6f581ad4ba6231998 are included?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I specified the ECMA version and aligned the variable names. I also added a test case from the reference.
PR Checklist
Overview
TODO: docs? maybe it can skip. Because
option
depends oneslint
ignoreUsingDeclarations
option,Add boolean type option, default is
false
. [ref](Ignore even if not referenced in the code block.)ignoreUsingDeclarations
is enable, ignore even if not referenced in the code block.options.ignoreUsingDeclarations
is enable &&def.parent.kind
isusing
orawait using
conditions.ref