eslint-plugin-vue
eslint-plugin-vue copied to clipboard
`lines-around-comment` in template tag
Please describe what the rule should do:
This is rule is identical to existing eslint rule lines-around-comment. This will allows us to write more readable code by adding new line before comments.
What category should the rule belong to?
[x] Enforces code style (layout) [ ] Warns about a potential error (problem) [ ] Suggests an alternate way of doing something (suggestion) [ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
<template>
<v-btn color="primary">
<span>Activator</span>
<!-- Menu -->
<v-menu activator="parent">
<!-- List -->
<v-list>
<!-- List item -->
<v-list-item
v-for="lang in props.languages"
:key="lang.i18nLang"
:value="lang.i18nLang"
>
<!-- Flag -->
<v-list-item-avatar start>
<div :class="lang.flagpackClass" />
</v-list-item-avatar>
<!-- Flag label -->
<v-list-item-title>{{ lang.label }}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-btn>
</template>
with this rule
<template>
<v-btn color="primary">
<span>Activator</span>
<!-- Menu -->
<v-menu activator="parent">
<!-- List -->
<v-list>
<!-- List item -->
<v-list-item
v-for="lang in props.languages"
:key="lang.i18nLang"
:value="lang.i18nLang"
>
<!-- Flag -->
<v-list-item-avatar start>
<div :class="lang.flagpackClass" />
</v-list-item-avatar>
<!-- Flag label -->
<v-list-item-title>{{ lang.label }}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-btn>
</template>
Additional context None
The options need to be different than in the ESLint core rule, as there is no distinction between line comment and block comment in HTML. Which options do you suggest?
Definitely, it will be different than eslint core. I can't think of options. Maybe there can be just rule on/off option 😉
BTW, I must say thanks for your quick responses.
And, One more thank you for creating utils for eslint. By using this repo's utils I was able to create our team's internal eslint rule.
Huge thanks 🙏🏻