# san/no-unused-components

disallow registering components that are not used inside templates

  • ⚙️ This rule is included in all of "plugin:san/essential", "plugin:san/strongly-recommended" and "plugin:san/recommended".

# 📖 Rule Details

This rule reports components that haven't been used in the template.

<!-- ✓ GOOD --> <template> <div> <h2>Lorem ipsum</h2> <the-modal> <the-button>CTA</the-button> </the-modal> </div> </template> <script> import TheButton from 'components/TheButton.san' import TheModal from 'components/TheModal.san' export default { components: { 'the-button': TheButton, 'the-modal': TheModal } } </script>
Now loading...
<!-- ✗ BAD --> <template> <div> <h2>Lorem ipsum</h2> <the-modal /> </div> </template> <script> import TheButton from 'components/TheButton.san' import TheModal from 'components/TheModal.san' export default { components: { 'the-button': TheButton, // Unused component 'the-modal': TheModal // Used component } } </script>
Now loading...

# 🔧 Options

nothing

# 🔍 Implementation

Last Updated: 10/26/2021, 7:23:11 AM