eslint-plugin-vue-scoped-css
eslint-plugin-vue-scoped-css copied to clipboard
Support router-link, nuxt-link and the like
For example:
<template>
<nuxt-link :to="`#`">button</nuxt-link>
</template>
<style scoped>
a {
color: red;
}
</style>
nuxt-link
is converted to a
tag, but I get error: The selector `a` is unused
.
Please support.
Maybe something like this in the settings:
'vue-scoped-css/no-unused-selector': ['warn', {
'equalTags': {
'nuxt-link': 'a',
'n-link': 'a',
'NuxtLink': 'a',
'NLink': 'a',
'router-link': 'a'
},
}]
Whether <nuxt-link>
has an a tag depends on the implementation, so I think you need to give it a new class.
<template>
<nuxt-link class="foo" :to="`#`">button</nuxt-link>
</template>
<style scoped>
.foo {
color: red;
}
</style>
So I don't want to add that option.
It’s maybe a better css design, but still, as you said it depends on the implementation so it makes sense to enable it as a custom option.
What about <router-link tag="xy">
? This should be clear which tag it's using.
Any updates on this?