Skip to content

v-icon and raw text #25

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

Closed
deen13 opened this issue Aug 2, 2019 · 4 comments
Closed

v-icon and raw text #25

deen13 opened this issue Aug 2, 2019 · 4 comments
Labels

Comments

@deen13
Copy link

deen13 commented Aug 2, 2019

Hey @kazupon,

first i'd like to thank you for your great work. 🎉

I've just added vue-i18n linting to our vuetify project and noticed several warnings about raw-text within our v-icon slots.

warning: raw text 'mdi-car' is used (vue-i18n/no-raw-text) at 
src/views/systems/Systems.vue:11:38:
  10 |           <v-list-tile-avatar>
> 11 |             <v-icon slot="activator">mdi-car</v-icon>
     |                                      ^
  12 |           </v-list-tile-avatar>
  13 |           <v-list-tile-content @click="goToDashboard(system)">

What would be your approach to deal with that kind of warnings? In our project those icons have no need to be localised.

@kazupon
Copy link
Member

kazupon commented Aug 2, 2019

Thank you for your feedback!

One workaround is to comment eslint-disable as follows:
This allows us to ignore lint on the next line.

<!-- eslint-disable vue-i18n/no-raw-text -->
<v-icon slot="activator">mdi-car</v-icon>

The other is to provide an option to set component tags to be ignored in the now-raw-text rule of eslint-plugin-vue-i18n.
I'll plan to consider supporting this option. 💪

@stevelacey
Copy link
Contributor

#31

@kazupon
Copy link
Member

kazupon commented Oct 2, 2019

I've just released out v0.3.0

@orvisevans
Copy link

orvisevans commented Feb 10, 2022

This appears to work well for kebab-case nodes like v-icon but not for PascalCase nodes like VIcon.
For now I'm using the workaround of { ignorePattern: '^mdi-.*$' } since that covers the icons we use in our VIcon components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants