Skip to content

aria-proptypes rule incorrectly fails when converting Boolean variable to string #1040

Open
@kburk1997

Description

Hello,

I am using eslint-plugin-jsx-a11y in a custom component library. One of our custom components sets aria-expanded based on a boolean variable:

@State() private _booleanVar: boolean;

renderComponent(): JSX.Element {
    return (
        <button aria-expanded={`${_booleanVar}`}>Test</button>
    );
}

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?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions