Skip to content

[vue/component-name-in-template-casing] False positive for dynamic component in template #2048

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

Closed
2 tasks done
Ky6uk opened this issue Nov 24, 2022 · 0 comments · Fixed by #2069
Closed
2 tasks done

Comments

@Ky6uk
Copy link

Ky6uk commented Nov 24, 2022

I've found a false positive scenario when TypeScript is enabled and type Component is imported from the vue library. Not pretty sure this is the problem with this plugin. 🤔

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: v8.28.0
  • eslint-plugin-vue version: v9.8.0
  • @typescript-eslint/parser version: v5.44.0
  • Node version: v18.12.0
  • Operating System: Mac OS

Please show your full configuration:

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

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

    "rules": {
        "vue/component-name-in-template-casing": "error"
    }
}

What did you do?

<template>
  <component />
</template>

<script lang="ts" setup>
  import { type Component } from 'vue';
</script>

What did you expect to happen?

No any issues with code.

What actually happened?

App.vue
  2:3  error  Component name "component" is not PascalCase  vue/component-name-in-template-casing

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

Repository to reproduce this issue

https://github.com/Ky6uk/eslint-vue-component-name-in-template-casing-bug

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