[Vuejs]-Eslint with Vue gives function is defined but never used no-unused-vars

1👍

It literally tells you what the problem is

Don’t remove unused var checks in eslint, thats just lazy.

It sees two problems with your code:

  1. You are using composition API, yet you have not included setup in your script tag. Your script opening tag should look like <script setup> this. Ref: docs
  2. Your show function doesn’t use icon variable. So it should be removed since it creates unnecessary noise in the code.

Hope this helps

Leave a comment