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-refs doesn't take Vue 2 Composition API plugin into account #1504

Closed
2 tasks done
jacekkarczmarczyk opened this issue Jun 1, 2021 · 1 comment
Closed
2 tasks done

Comments

@jacekkarczmarczyk
Copy link

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: 7.27.0
  • eslint-plugin-vue version: 7.10.0
  • Node version: 4.15.5
  • Operating System: win10

Please show your full configuration:

module.exports = {
  extends: [
    'plugin:vue/recommended',
  ],
  plugins: ['vue'],
  rules: {
    'vue/no-unused-refs': 'error',
  },
};

What did you do?

<template>
  <div ref="r" />
</template>

<script>
import { defineComponent, ref, watchEffect } from '@vue/composition-api';

export default defineComponent({
  setup () {
    const r = ref();
    watchEffect(() => console.log(r.value));
    return { r };
  },
});
</script>

What did you expect to happen?
no error

What actually happened?

ESLint: 'r' is defined as ref, but never used.(vue/no-unused-refs)

Repository to reproduce this issue

@jacekkarczmarczyk jacekkarczmarczyk changed the title vue/no-unused-refs doesn't take composition api into account vue/no-unused-refs doesn't take Vue 2 Composition API plugin into account Jun 1, 2021
@ota-meshi
Copy link
Member

This issue was fixed in #1556, so close it.

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

No branches or pull requests

2 participants