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" work incorrect with useVModels from "@vueuse/core" #2062

Open
2 tasks done
galsim opened this issue Dec 14, 2022 · 2 comments
Open
2 tasks done

Comments

@galsim
Copy link

galsim commented Dec 14, 2022

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.22.0
  • eslint-plugin-vue version: ^9.3.0
  • Node version: v16.17.1
  • Operating System: macOS 13.0.1

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'
  ],
  parserOptions: {
    ecmaVersion: 'latest'
  },
  rules: {
    "vue/no-unused-properties": ["error", {
      "groups": ["setup", "props"],
    }]
  }
}

What did you do?

<script lang="ts">
import { defineComponent } from 'vue'
import { useVModels } from '@vueuse/core'

export default defineComponent({
  props: {
    msg: {
      type: String,
      required: true
    }
  },
  setup(props,{ emit }) {
    const {
      msg: msgModel
    } = useVModels(props, emit)

    return {
      msgModel
    }
  }
})
</script>

What did you expect to happen?
I expected no eslint errors, because I use msg props through useVModels

What actually happened?
image

Repository to reproduce this issue
https://github.com/galsim/no-unused-properties-use-v-models

@FloEdelmann
Copy link
Member

I don't think we should support this specific function from VueUse. But we should probably consider all props used when they are passed to a function that is not declared in the same file.

@galsim
Copy link
Author

galsim commented Sep 7, 2023

Any updates here?

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