Skip to content

[no-unused-properties] can't recogonize props.xxx used in template #2193

Closed
@tjx666

Description

@tjx666

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.16.0
  • Operating System: MacOS

Please show your full configuration:

{
    "rules": {
        'vue/no-unused-properties': 'error',
    }
}

What did you do?

<template>
    <div>
        {{ props.age }}
    </div>
</template>

<script lang="ts" setup>
const props = defineProps<{
    // will show vue/no-unused-properties error
    age: number;
}>();
</script>

What did you expect to happen?

No errors.

What actually happened?

report vue/no-unused-properties error

Repository to reproduce this issue

playground link

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions