eslint-plugin-vue
eslint-plugin-vue copied to clipboard
component-name-in-template-casing inconsistent behavior
Checklist
- [x] I have tried restarting my IDE and the issue persists.
- [x] I have read the FAQ and my problem is not listed.
Tell us about your environment
- ESLint version: 8.7.0
- eslint-plugin-vue version: 8.3.0
- Node version: 16.13.1
- Operating System: MacOS Monterey
Please show your full configuration:
module.exports = {
env: {
node: true,
'vue/setup-compiler-macros': true,
},
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'@vue/typescript/recommended',
],
ignorePatterns: [
'**/*.mdx',
'**/*.css',
],
rules: {
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/indent': ['error', 2],
'linebreak-style': [
'error',
'unix',
],
'quotes': [
'error',
'single', {
'allowTemplateLiterals': true,
},
],
'semi': [
'error',
'never',
],
'space-before-function-paren': [
'error',
'always',
],
'keyword-spacing': [
'error',
],
'space-before-blocks': [
'error',
],
'object-curly-spacing': [
'error',
'always',
],
'eol-last': [
'error',
'always',
],
'comma-dangle': [
'error',
{
'arrays': 'always-multiline',
'objects': 'always-multiline',
'imports': 'always-multiline',
'exports': 'always-multiline',
'functions': 'never',
},
],
},
}
What did you do?
collectibles.vue (throws multi word error)
<template>
<div>Collectibles</div>
</template>
<script setup lang="ts">
</script>
collectibles.vue (error disappears)
<template>
<div>Collectibles</div>
</template>
<script setup lang="ts">
import Foo from '#/foo.vue'
</script>
What did you expect to happen?
Both components to throw the component-name-in-template-casing
error, yet only the on without anything in the script does. (Or neither should throw the error)
However as soon as type anything in the script section, the error disappears. I think this is an issue with <script setup>
?
What actually happened?
No raw output from Eslint in VSCode, only directly in the IDE:
Repository to reproduce this issue
No repo
A repository to test this would make debugging a lot easier.