eslint-plugin-vue
eslint-plugin-vue copied to clipboard
`vue/no-unused-properties` does not work with `defineNuxtComponent()`
Checklist
- [x] I have tried restarting my IDE and the issue persists.
- [x] I have read the FAQ and my problem is not listed.
Tell us about your environment
- ESLint version:
8.41.0 - eslint-plugin-vue version:
9.14.0 - Node version:
18 - Operating System: MacOS 13.3.1 (a)(22E772610a)
Please show your full configuration:
module.exports = {
extends: [
"plugin:vue/vue3-recommended",
],
rules: {
"vue/no-unused-properties": [
"error",
{
groups: ["props", "data", "computed", "methods"],
deepData: false,
ignorePublicMembers: false,
},
],
},
};
What did you do?
<template>
<div>
<span>Hello</span>
</div>
</template>
<script lang="ts">
export default defineNuxtComponent({
name: 'App',
data() {
return {
msg: 'Welcome to Nuxt3', // This data is not used.
};
},
});
</script>
What did you expect to happen?
Data msg should be warned like below.
This warning is shown without defineNuxtComponent.
It seems to be rerated to https://github.com/vuejs/eslint-plugin-vue/issues/2057.
What actually happened? No warning is shown.
Repository to reproduce this issue
https://github.com/uralogical/nuxt3_playground
feat/add_eslint is reproduction branch.
defineNuxtComponent is not yet supported. We might add this for v10, see #2166.
FWIW, I'm using this for now:
import { defineNuxtComponent as defineComponent } from '#imports'
export default defineComponent({
...
})
my workaround https://github.com/vuejs/eslint-plugin-vue/pull/2311