hluisson / eslint-plugin-jsx-expressions

Rules for safe logical expressions in JSX
95 stars 12 forks source link

Add values, additional example #9

Closed karlhorky closed 1 year ago

karlhorky commented 1 year ago

Thanks for this plugin @hpersson, really cool! 🙌 I will include it in our configuration for our bootcamp students

Reading through the documentation here, it seems that these uninitialized variables do not actually raise warnings/errors with the plugin - they need to have a type of number or string, either by initializing with a value (like this PR does) or assigning a type.

Also added an example of a number constant that does not raise problems with the plugin.

If you want additional incorrect examples with a TS type annotation, I can add these as well.

hluisson commented 1 year ago

Thanks! These documentation updates look good to me. 👍

karlhorky commented 1 year ago

Glad to help :) thanks for the merge!