-
- Notifications
You must be signed in to change notification settings - Fork 696
Closed
Labels
Description
Checklist
- I have tried restarting my IDE and the issue persists.
- I have read the FAQ and my problem is not listed.
Tell us about your environment
- ESLint version: v8.54.0
- eslint-plugin-vue version: v9.19.2
- Node version: v18.17.1
- Operating System: Ubuntu 23.04
Please show your full configuration:
/* eslint-env node */ require('@rushstack/eslint-patch/modern-module-resolution') module.exports = { root: true, 'extends': [ 'plugin:vue/vue3-essential', 'eslint:recommended', '@vue/eslint-config-typescript', '@vue/eslint-config-prettier/skip-formatting' ], parserOptions: { ecmaVersion: 'latest' }, rules: { "vue/no-unused-emit-declarations": "error", } }
What did you do?
<script setup lang="ts"> const emit = defineEmits({"foo": () => true}) </script> <template> <button @click="emit('foo')">Foo</button> </template> </style>
What did you expect to happen?
The emit shouldn't be flagged as unused since it's used in the template
What actually happened?
The emit is flagged as unused:
6:27 error `foo` is defined as emit but never used vue/no-unused-emit-declarations
Repository to reproduce this issue
maiolica and tryforceful