Skip to content

[no-undef-components] false positive for "setup" components #1975

Closed
@Ky6uk

Description

@Ky6uk

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.23.1
  • eslint-plugin-vue version: 9.5.0
  • Node version: 18.4.0
  • Operating System: Mac OS

Please show your full configuration:

{
    "parserOptions": {
        "parser": "@typescript-eslint/parser",
        "extraFileExtensions": [".vue"]
    },

    "extends": ["plugin:vue/base"],

    "rules": {
        "vue/no-undef-components": "error"
    }
}

What did you do?

<template>
  <AppHeader />
</template>

<script setup lang="ts">
  import AppHeader from '@/components/AppHeader.vue';
</script>

What did you expect to happen?

No error produced.

What actually happened?

/private/tmp/eslint-vue-no-undef-components-bug/App.vue
  2:3  error  The '<AppHeader>' component has been used, but 'AppHeader' only refers to a type  vue/no-undef-components

✖ 1 problem (1 error, 0 warnings)

Repository to reproduce this issue

https://github.com/Ky6uk/eslint-vue-no-undef-components-bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions