Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue/no-unused-properties does not work with defineNuxtComponent() #2191

Open
2 tasks done
uralogical opened this issue May 25, 2023 · 3 comments · May be fixed by #2311
Open
2 tasks done

vue/no-unused-properties does not work with defineNuxtComponent() #2191

uralogical opened this issue May 25, 2023 · 3 comments · May be fixed by #2311

Comments

@uralogical
Copy link

uralogical commented May 25, 2023

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: 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.

スクリーンショット 2023-05-25 21 34 25

It seems to be rerated to #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.

@FloEdelmann
Copy link
Member

defineNuxtComponent is not yet supported. We might add this for v10, see #2166.

@IlyaSemenov
Copy link

FWIW, I'm using this for now:

import { defineNuxtComponent as defineComponent } from '#imports'

export default defineComponent({
  ...
})

@sugitata sugitata linked a pull request Nov 13, 2023 that will close this issue
@sugitata
Copy link

my workaround #2311

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants