Skip to content

Files

Latest commit

 

History

History
55 lines (38 loc) · 901 Bytes

no-empty-component-block.md

File metadata and controls

55 lines (38 loc) · 901 Bytes

Pattern: Use of empty component block

Issue: -

Description

This rule disallows the <template> <script> <style> block to be empty.

<!-- ✓ GOOD -->
<template>
  <p>foo</p>
</template>

<script>
  console.log('foo')
</script>

<style>
  p {
    display: inline;
  }
</style>

<template src="./template.html"></template>
<template src="./template.html" />

<script src="./script.js"></script>
<script src="./script.js" />

<style src="./style.css"></style>
<style src="./style.css" />


<!-- ✗ BAD -->
<template></template>
<template />
<template src="" />

<script></script>
<script />
<script src="" />

<style></style>
<style />
<style src="" />

Further Reading