Skip to content

False positives with inline svg content #580

Closed
@ThomasR

Description

@ThomasR

Tell us about your environment

  • ESLint Version: 5.6.0
  • eslint-plugin-vue Version: 5.0.0-beta3
  • Node Version: 10

Please show your full configuration:

{
  root: true,
  extends: ['plugin:vue/recommended'],
  rules: {
    'vue/component-name-in-template-casing': 'error'
  }
}

What did you do? Please include the actual source code causing the issue.
I'm writing an app that makes use of SVG components. Apparently this does not work well with eslint-plugin-vue, even though the app works just fine.

The following is a minimal example to demonstrate the issues:

App.vue:

<template>
  <svg>
    <my-content />
  </svg>
</template>

<script>
import MyContent from './MyContent';

export default {
  components: {
    MyContent
  }
};
</script>

MyContent.vue:

<template>
  <text y="20">
    Hello, World!
  </text>
</template>

What did you expect to happen?
There should be one error

…/src/App.vue
  3:5  error  Component name "my-content" is not PascalCase  vue/component-name-in-template-casing

What actually happened? Please include the actual, raw output from ESLint.

  • the expected error above is not shown
  • two errors are shown, both are false positives
…/src/App.vue
  12:5  error  The "MyContent" component has been registered but not used  vue/no-unused-components

…/src/MyContent.vue
  2:3  error  Component name "text" is not PascalCase  vue/component-name-in-template-casing

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions