jsx-eslint / eslint-plugin-react

React-specific linting rules for ESLint
MIT License
8.86k stars 2.76k forks source link

[Fix] `jsx-no-leaked-render`: prevent wrongly adding parens #3700

Closed developer-bandi closed 4 months ago

developer-bandi commented 4 months ago

Closes #3698

In jsx-no-leaked-render rule, connection && (hasError || hasErrorUpdate) code is changed to !!connection && hasError || hasErrorUpdate but two code is not equal.

so if right exprssion's((hasError || hasErrorUpdate)) type is LogicalExpression, add parentheses both side

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.75%. Comparing base (b7780ce) to head (730bac9).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3700 +/- ## ======================================= Coverage 97.75% 97.75% ======================================= Files 133 133 Lines 9462 9462 Branches 3466 3466 ======================================= Hits 9250 9250 Misses 212 212 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.