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
vue/component-name-in-template-casing
is not ignoring some built-in components
#1722
Comments
Can't you use However, the docs clearly don't match the behavior, so either of them needs to be adjusted. |
I think that would be inconsistent with our preference of having built-in components kebab-cased, and also these built-ins are always kebab cased in Vue docs |
I noticed this file, but it is not imported anywhere ... except in the vue3 builtin file which is in turn not imported anywhere. Not sure if that is connected with this bug https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/utils/vue2-builtin-components.js |
I think this rule is the only one where we enforce the casing of built-in components, isn't it? In the Vue docs, they are kebab-case, but so are custom components: https://v3.vuejs.org/guide/component-basics.html However, in the relevant style guide section, built-in components are not explicitly mentioned: https://v3.vuejs.org/style-guide/#component-name-casing-in-templates-strongly-recommended So I think it's a matter of taste. IMO, they should not be excluded, but the docs should be adjusted to explicitly mention that they are included. Users who want to exclude them can use the
I don't know whether/how this file is/was used. @ota-meshi Can you help here? |
I agree with you.
Used it here: |
@valentinoli I just noticed that the note you linked to is in the docs of another rule: So I think there is nothing that needs to be done here.
Since the behavior is expected, I added test cases to document this in #1737. |
@valentinoli Note that you should adapt your Your regex Either add parentheses to the regex: - ignores: ['/^component|client-only|keep-alive$/']
+ ignores: ['/^(component|client-only|keep-alive)$/'] Or (even better) use separate strings: - ignores: ['/^component|client-only|keep-alive$/']
+ ignores: ['component', 'client-only', 'keep-alive'] |
My bad! Sorry about that. |
Much appreciated tip, thank you! |
@ota-meshi |
You can use the search. |
Ok, I thought I already did that. Sorry and thanks! |
Checklist
Tell us about your environment
Please show your full configuration:
What did you do?
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
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:The text was updated successfully, but these errors were encountered: