Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Latest commit

 

History

History
57 lines (45 loc) · 791 Bytes

jsx-conditional-parens.md

File metadata and controls

57 lines (45 loc) · 791 Bytes

jsx-conditional-parens

When using conditionals inside JSX, this rule enforces no gratuitous parenthesis around the final clause containing the JSX itself.

Rule Details

The following patterns are considered problems:

/*eslint saxo/jsx-conditional-parens: "error"*/

return
    <a>
    {
        a &&
            (<b/>)
    }
    </a>;

The following patterns are not considered warnings:

/*eslint saxo/jsx-conditional-parens: "error"*/

return
    <a>
    {
        a &&
            <b/>
    }
    </a>;
/*eslint saxo/jsx-conditional-parens: "error"*/

return
    <a>
    {
        (a &&
            <b/>)
    }
    </a>;
/*eslint saxo/jsx-conditional-parens: "error"*/

return
    <a>
    {
        (a) &&
            <b/>
    }
    </a>;