Open
Description
The following forms are both correct and equivalent:
<i className="fa fa-camera-retro fa-lg" aria-hidden="true" />
<i className="fa fa-camera-retro fa-lg" aria-hidden={true} />
// OR
<i className="fa fa-camera-retro fa-lg" aria-hidden />
This proposal is that a rule would prefer the 2nd form. That is, use the more specific literal type for these attributes. This would only apply when using a literal. There are several aria-*
that are booleanish. This rule could apply to all of them.
The benefit is a more consistent codebase that avoids flip-flopping on style. As well, using a boolean in a true/false context feels more natural and explicit in intent.
The types defined by @types/react
at: