Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 928 Bytes

html-no-self-closing.md

File metadata and controls

39 lines (29 loc) · 928 Bytes

disallow self-closing elements (html-no-self-closing)

  • ⚠️ This rule was deprecated and replaced by html-self-closing rule.
  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

Self-closing (e.g. <br/>) is syntax of XML/XHTML. HTML ignores it.

📖 Rule Details

This rule reports every self-closing element except XML context.

👎 Examples of incorrect code for this rule:

<template>
    <div>
        <img src="./logo.png"/>
    </div>
</template>

👍 Examples of correct code for this rule:

<template>
    <div>
        <img src="./logo.png">
        <svg>
            <!-- this is XML context -->
            <rect width="100" height="100" />
        </svg>
    </div>
</template>

🔧 Options

Nothing.