eslint-plugin-vue icon indicating copy to clipboard operation
eslint-plugin-vue copied to clipboard

component-name-in-template-casing inconsistent behavior

Open TheDutchCoder opened this issue 3 years ago • 1 comments

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: image

Repository to reproduce this issue

No repo

TheDutchCoder avatar Jan 19 '22 17:01 TheDutchCoder

A repository to test this would make debugging a lot easier.

FloEdelmann avatar Feb 02 '22 21:02 FloEdelmann