Skip to content

vue/component-name-in-template-casing is not ignoring some built-in components #1722

@valentinoli

Description

@valentinoli

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: 7.32.0
  • eslint-plugin-vue version: 7.17.0
  • Node version: 14.17.6
  • Operating System: Windows 10

Please show your full configuration:

module.exports = {
  root: true,
  env: {
    browser: true,
    node: true
  },
  parserOptions: {
    parser: '@babel/eslint-parser',
    requireConfigFile: false
  },
  extends: [
    '@nuxtjs',
    'plugin:prettier/recommended',
    'plugin:nuxt/recommended'
  ],
  plugins: ['prettier'],
  // add your custom rules here
  rules: {
    'no-console': [
      'warn',
      {
        allow: ['info', 'warn', 'error']
      }
    ],
    'vue/valid-v-slot': [
      'error',
      {
        allowModifiers: true
      }
    ],
    'vue/no-unregistered-components': ['off', {}],
    'vue/component-name-in-template-casing': [
      'error',
      'PascalCase',
      {
        registeredComponentsOnly: false
      }
    ]
  }
}

What did you do?

<template>
  <component :is="someComponent"></component>
</template>

What did you expect to happen?
As the docs explain in the note, I expected the vue/component-name-in-template-casing rule to ignore the built-in <component>

What actually happened?

Raw output from ESLint

Component name "component" is not PascalCase. eslint(vue/component-name-in-template-casing)

Note: Same story for <client-only> and <keep-alive> built-ins. However, <slot> and <template> are ignored.

Repository to reproduce this issue

https://github.com/hestiaAI/hestialabs-experiences/

I added the following configuration to .eslintrc.js to fix the issue temporarily:

ignores: ['/^component|client-only|keep-alive$/']

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions