title: Double quote escaping for valid JSON
body: <p>I have a string say - <code>this is a &quot;string that needs&quot; escaping&quot;</code>. This string ultimately gets saved in a JSON object so the double quotes must be escaped properly.</p>
  <p>I've implemented a utility function to escape it -</p>
  <pre><code>export function escapeJsonString(str) {
    // eslint-disable-next-line no-useless-escape
    return str.replace(/&quot;/g, '\&quot;');
  }
  </code></pre>
  <p>The output form this is exactly what I need - <code>this is a \&quot;string that needs\&quot; escaping</code>. However, eslint complains that the escape character is useless?</p>
  <p>Is there a better way to do this while ensuring I am compliant with ESLint? I'd prefer not to turn off this rule.</p>