Vue supports JavaScript expressions in HTML attribute values via directives. Sometimes whitespaces may or may not appear on either side of an expression, and we may expect to maintain maintain a uniform style within a project.
This rule does not affect static (string) attributes and mustache interpolation.
This rule is fixable.
This rule has a string option:
"always"
expects one space between expression and quotes."never"
(default) expects no spaces between expression and quotes.
<template>
<p v-foo=" bar "></p>
</template>
<template>
<p :foo=" bar "></p>
</template>
<template>
<p @foo=" bar "></p>
</template>
<template>
<!-- eslint galaxy/vue-attribute-spacing: ["error", "always"] -->
<p v-foo="bar"></p>
</template>
<template>
<!-- eslint galaxy/vue-attribute-spacing: ["error", "always"] -->
<p :foo="bar"></p>
</template>
<template>
<!-- eslint galaxy/vue-attribute-spacing: ["error", "always"] -->
<p @foo="bar"></p>
</template>
<template>
<p :foo="bar"></p>
</template>
<template>
<p foo=" bar "></p>
</template>
<template>
<p>{{ bar }}</p>
</template>
<template>
<!-- eslint galaxy/vue-attribute-spacing: ["error", "always"] -->
<p :foo=" bar "></p>
</template>