Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 1.54 KB

File metadata and controls

62 lines (42 loc) · 1.54 KB

ember/template-quotes

🔧 This rule is automatically fixable by the --fix CLI option.

Enforce the consistent use of either double or single quotes.

Examples

Enforce either:

<template>
  <div class='my-class'>test</div>
  {{my-helper 'hello there'}}
</template>

or:

<template>
  <div class="my-class">test</div>
  {{my-helper "hello there"}}
</template>

Configuration

The following values are valid configuration:

  • string -- "double" requires the use of double quotes wherever possible, "single" requires the use of single quotes wherever possible
  • object -- { curlies: "single"|"double"|false, html: "single"|"double"|false } - requires different quotes for Handlebars and HTML syntax

For the object config, the properties curlies and html can be passed one of the following values: "single", "double", or false. If false is passed to a property, it will be as if this rule is turned off for that specific syntax.

With the config { curlies: false, html: "double" }, this would be forbidden:

<template>
  <div foo='bar'></div>
</template>

However, this would be allowed:

<template>
  {{component "foo"}}
  {{test x='y'}}
  <div foo="bar"></div>
</template>

Related Rules

References