You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
However, this proposal is about when an attribute is the literal string "true" which of course is not a boolean. So my understanding is the rule doesn't apply to the proposal.
aha, good point - in that case, we'd want an aria-specific rule in this project to force true over "true", at which point the other rule can kick in :-)
The following forms are both correct and equivalent:
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:https://github.com/DefinitelyTyped/DefinitelyTyped/blob/5b5ec4e409bcd8d422efc505db5b0223c0c5af56/types/react/index.d.ts#L2591-L2812
The text was updated successfully, but these errors were encountered: