Skip to content

Latest commit

 

History

History
54 lines (34 loc) · 1.42 KB

quotes.md

File metadata and controls

54 lines (34 loc) · 1.42 KB

quotes

💅 The extends: 'stylistic' property in a configuration file enables this rule.

🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

Enforce the consistent use of either double or single quotes.

Examples

Enforce either:

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

or:

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

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:

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

However, this would be allowed:

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

Related Rules

References