0

When using Vue composition API with <script setup>, components are just imported like

import Component from '@/components/Component.vue';

How do I keep eslint from applying the no-unused-var rule here, without disabling the rule completely? I would like it to detect "real" unused variables but those imports are in fact used in the template section.

3
  • What is your eslint config? You should use plugins for any specific functionality, e.g. vue/script-setup-uses-vars in this case Commented Sep 11, 2024 at 18:33
  • If the imported component is actually used, there will be no warning in eslint Commented Sep 11, 2024 at 19:39
  • Did you find any solution? I am having this problem where eslint doesn't detect that the variables are used in the externally referenced template .html file. Commented Oct 24, 2024 at 18:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.