Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 1.14 KB

File metadata and controls

59 lines (42 loc) · 1.14 KB

ember/template-self-closing-void-elements

💼 This rule is enabled in the following configs: strict-gjs, strict-gts.

🔧 This rule is automatically fixable by the --fix CLI option.

Requires void elements to be self-closing.

Rule Details

Void elements (like <img>, <br>, <input>, etc.) should be self-closing for consistency and to match HTML5 conventions.

Examples

Examples of incorrect code for this rule:

<template>
  <img src="foo.jpg">
</template>
<template>
  <br>
</template>
<template>
  <input type="text">
</template>

Examples of correct code for this rule:

<template>
  <img src="foo.jpg" />
</template>
<template>
  <br />
</template>
<template>
  <input type="text" />
</template>

References