validateQuoteMarks

Requires all quote marks to be either the supplied value, or consistent if true

Types: Boolean, String or Object

Values:

  • "\"": all strings require double quotes
  • "'": all strings require single quotes
  • true: all strings require the quote mark first encountered in the source code
  • Object:
    • escape: allow the "other" quote mark to be used, but only to avoid having to escape
    • mark: the same effect as the non-object values
    • ignoreJSX: ignore JSX nodes

JSHint: quotmark

Example

"validateQuoteMarks": "\""
"validateQuoteMarks": { "mark": "\"", "escape": true }
Valid example for mode { "mark": "\"", "escape": true }
var x = "x";
var y = '"x"';
Invalid example for mode { "mark": "\"", "escape": true }
var x = "x";
var y = 'x';
Valid example for mode { "mark": "'", "escape": true, "ignoreJSX": true }
<div className="flex-card__header">{this.props.children}</div>;
Valid example for mode "\"" or mode true
var x = "x";
Valid example for mode "'" or mode true
var x = 'x';
Invalid example for mode true
var x = "x", y = 'y';
Rule source
Test source