JS.VUE.NO.SPACES.AROUND.EQUAL.SIGNS.IN.ATTRIBUTE

Disallow spaces around equal signs in attribute

Rule Details

This rule disallow spaces around equal signs in attribute.

{'vue/no-spaces-around-equal-signs-in-attribute': ['error']}

Copy
<template>
  <!-- BAD -->
  <div class = "item"></div>
  <!-- GOOD -->
  <div class="item"></div>
</template>

HTML5 allows spaces around equal signs. But space-less is easier to read, and groups entities better together.

Options

Copy
{
  "vue/no-spaces-around-equal-signs-in-attribute": ["error"]
}

Further Reading

  • HTML5 Style Guide - W3Schools Spaces and Equal Signs (https://www.w3schools.com/html/html5_syntax.asp)

The content on this page is adapted from the ESLint User Guide. Copyright © OpenJS Foundation and other contributors, www.openjsf.org. All rights reserved. https://eslint.org/docs/rules/