Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 521 Bytes

self-closing-comp.md

File metadata and controls

21 lines (13 loc) · 521 Bytes

Prevent extra closing tags for components without children (self-closing-comp)

Components without children can be self-closed to avoid unnecessary extra closing tag.

Rule Details

The following patterns are considered warnings:

var HelloJohn = <Hello name="John"></Hello>;

The following patterns are not considered warnings:

var contentContainer = <div className="content"></div>;

var HelloJohn = <Hello name="John" />;

var Profile = <Hello name="John"><img src="picture.png" /></Hello>;