-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(eslint-plugin): [no-unused-vars] handle logical assignment #7854
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
Conversation
Thanks for the PR, @yeonjuan! 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 site configuration. |
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.
Looks great to me, thanks! No blocking changes on my end - just raising a question or two on the readability. If you don't have time or interest, no worries, we can merge.
|
||
/** | ||
* Checks whether the given operator is a logical assignment operator or not. | ||
* @param operator The operator |
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.
[Proofreading] Just nitpicking a bit: @param operator The operator
gives no new information and just takes up space.
- I wrote a lint rule for this 😄 https://github.com/JoshuaKGoldberg/are-docs-informative -> https://github.com/gajus/eslint-plugin-jsdoc/blob/aefceca7413ac0263ed1b58127fff4efca89de4f/docs/rules/informative-docs.md#readme.
- Filed Repo: Bring in eslint-plugin-jsdoc recommended-typescript-error preset #7855 to lint for it automatically
* @param operator The operator |
* @param operator The operator | ||
* @returns True if the operator is a logical assignment operator. | ||
*/ | ||
function isLogicalAssignmentOperator(operator: string): boolean { |
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.
[Style] Just curious, is it a strong preference on your end to make this a function? I can see an advantage of it being a bit more natural to read in the isUsedVariable
function, but it's a lot more lines this way.
I'm not particularly passionate about the issue, but would prefer it just be inlined (unless you have strong feelings).
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.
Thanks. I think the code reads well enough without the function, I'll change it.
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
PR Checklist
Overview