Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 492 Bytes

jsx-if-require-condition.md

File metadata and controls

42 lines (27 loc) · 492 Bytes

If tag must contain condition attribute (jsx-if-require-condition)

Warn if If tag is missing condition attribute.

Rule Details

The following patterns are considered warnings:

<If>
    <div/>
</If>

<If>
    <div/>
<Else/>
    <div/>
</If>

The following patterns are not warnings:

<If condition={foo}>
    <div/>
</If>

<If condition={foo}>
    <div/>
<Else/>
    <div/>
</If>

When Not To Use It

If you are not using JSX, you can disable this rule