--- pageClass: "rule-details" sidebarDepth: 0 title: "lodash-template/attribute-value-quote" description: "enforce quotes style of HTML attributes. (ex. :ok: `
` :ng: `
` `
`)" --- # lodash-template/attribute-value-quote > enforce quotes style of HTML attributes. (ex. :ok: `
` :ng: `
` `
`) - :gear: This rule is included in `"plugin:lodash-template/recommended-with-html"` and `"plugin:lodash-template/all"`. - :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. ## Rule Details This rule enforces the quotes style of HTML attributes. ```html <% /* eslint "lodash-template/attribute-value-quote": "error" */ %> ``` ## Options ```json { "lodash-template/attribute-value-quote": ["error", "double" | "single" | "either" | "prefer-double"] } ``` - `"double"` ... requires double quotes. - `"single"` ... requires single quotes. - `"either"` ... requires double quotes or single quotes. - `"prefer-double"` (default) ... requires double quotes or single quotes. if do not need escape double quotes, requires double quotes. ### Examples for this rule with `"single"` option: ```html <% /* eslint "lodash-template/attribute-value-quote": ["error", "single"] */ %> ``` ### Examples for this rule with `"either"` option: ```html <% /* eslint "lodash-template/attribute-value-quote": ["error", "either"] */ %> ``` ## Further Reading - [Google HTML/CSS Style Guide *HTML Quotation Marks*](https://google.github.io/styleguide/htmlcssguide.html#HTML_Quotation_Marks) - [HTML5 Style Guide - W3Schools *Quote Attribute Values*](https://www.w3schools.com/html/html5_syntax.asp) ## Implementation - [Rule source](https://github.com/ota-meshi/eslint-plugin-lodash-template/blob/master/lib/rules/attribute-value-quote.js) - [Test source](https://github.com/ota-meshi/eslint-plugin-lodash-template/blob/master/tests/lib/rules/attribute-value-quote.js)