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
jsx-a11y/aria-proptypes flags this as an error even though I'm converting a boolean to a string - is this a bug? Or is converting a boolean to string for aria-expanded no longer recommended?
The text was updated successfully, but these errors were encountered:
The issue is that we can't easily statically tell that that's a stringified boolean, If you do _booleanVar ? 'true' : 'false' then I expect it would work?
If the rule had access to the type information of _booleanVar, I feel like that wouldn't be too hard. I.e. Does the TemplateLiteral only have one express, and that expression is an Identifier who's type annotation is TSBooleanKeyword. With that said, that flow would require the typescript-eslint parser and that the code is in typescript.
Exactly - it's fine if there's improved behavior when type information is provided by the parser, as long as there's still some functionality for non-TS users.
Hello,
I am using
eslint-plugin-jsx-a11y
in a custom component library. One of our custom components setsaria-expanded
based on a boolean variable:jsx-a11y/aria-proptypes
flags this as an error even though I'm converting a boolean to a string - is this a bug? Or is converting a boolean to string foraria-expanded
no longer recommended?The text was updated successfully, but these errors were encountered: