Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the auto-fix behavior of the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aligns the no-unnecessary-boolean-literal-compare rule with its ESLint counterpart. The changes modify the autofix logic to correctly handle parenthesized expressions and leading trivia by using ast.SkipParentheses and utils.TrimNodeTextRange. Additionally, the test suite is substantially expanded with numerous new test cases to cover more edge cases and ensure behavioral parity with ESLint. The changes appear correct and well-tested.
1a3c25a to
198968f
Compare
…mentation Fix auto-fix output discrepancies where rslint produced extra whitespace or unwanted parentheses compared to the original ESLint rule, and add comprehensive test coverage for all operator/literal/type/config combinations.
198968f to
452e312
Compare
Summary
Fix auto-fix output discrepancies in
@typescript-eslint/no-unnecessary-boolean-literal-comparewhere rslint diverged from the original ESLint rule:false !== b), the fix included leading whitespace from the AST node'sPos(). Fixed by usingTrimNodeTextRangeto skip trivia.ParenthesizedExpressionnodes (unlike ESTree which is parenthesis-transparent), causing fix output like(b ?? false)instead ofb ?? false. Fixed by usingSkipParenthesesbefore extracting replacement text and checking precedence.==/!=), literal-on-left positions,falseliteral type, both nullable options false, nullable with literal on left, and the combined!+?? truefix path. Go and JS tests are fully in sync (22 valid + 47 invalid = 69 total).Verified via exhaustive 37-case end-to-end comparison: detection lines and fix outputs are identical between rslint and ESLint.
Related Links
N/A
Checklist