eslint-plugin-vue icon indicating copy to clipboard operation
eslint-plugin-vue copied to clipboard

vue/singleline-html-element-content-newline breaks <router-link> visual display

Open mariusa opened this issue 3 years ago • 2 comments

Found similar issue: https://github.com/vuejs/eslint-plugin-vue/issues/1633

What rule do you want to change? vue/singleline-html-element-content-newline

Does this change cause the rule to produce more or fewer warnings? don't know

How will the change be implemented? (New option, new default behavior, etc.)? don't know

Please provide some example code that this change will affect:

<router-link :to="parent">test</router-link>

What does the rule currently do for this code?

<router-link :to="parent">
                    test                
</router-link>

It adds whitespace, which leads to rendering the link in browser as "test_" (extra underlining until closing the tag)

What will the rule do after it's changed? stop adding whitespace:

<router-link :to="parent">test</router-link>

Additional context

mariusa avatar Dec 29 '21 21:12 mariusa

If <a> is ignored, <router-link> and <nuxt-link> should be ignored as well.

FloEdelmann avatar Dec 29 '21 23:12 FloEdelmann

<a href="">test</a> works fine (it is left like this), just tested. <router-link> is changed to add whitespace.

mariusa avatar Dec 30 '21 11:12 mariusa