jsx-eslint / eslint-plugin-react

React-specific linting rules for ESLint
MIT License
9k stars 2.77k forks source link

[Fix] `jsx-no-literals`: Avoid crashing on valueless boolean props #3823

Closed reosarevok closed 2 months ago

reosarevok commented 2 months ago

b8217ed5f4104bd18b54f77ea108ec081ebbbd49 removed the node.value check leading to this crashing on any valueless boolean prop such as <Component isWhatever />

This just readds the check.

Fixes https://github.com/jsx-eslint/eslint-plugin-react/issues/3820

codecov[bot] commented 2 months ago

Codecov Report

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

Project coverage is 97.66%. Comparing base (a09083b) to head (99e15e1). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3823 +/- ## ========================================== + Coverage 95.97% 97.66% +1.68% ========================================== Files 136 133 -3 Lines 9929 9917 -12 Branches 3677 3678 +1 ========================================== + Hits 9529 9685 +156 + Misses 400 232 -168 ```

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