I am implementing dynamic components where I use:
<component :is="component_name"></component>
However, eslint keeps returning this:
60:16 error The "component" component has been registered but not used
vue/no-unused-components
How can I disable the rule above on eslint?
You can disable that particular ESLint rule by writing the following at the top of your JavaScript file: /* eslint-disable vue/no-unused-components */
. Note that this may be after the first <script>
tag in a single-file component (ie. a .vue
file).
In your situation, however, you may find it more useful to just disable this error for a particular line by appending the following to the end of the problematic line causing the error: // eslint-disable-line vue/no-unused-components
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With