title: How can I use await fetch() in a promis so that it doesn't violate the eslint rule no-async-promise-executor?
body: <p>My code is violating the eslint rule <a href="https://eslint.org/docs/rules/no-async-promise-executor" rel="nofollow noreferrer">no-async-promise-executor</a> but I'm not sure how to refactor it so that it doesn't have the <code>async</code> in the <code>new Promise(async (resolve, reject) =&gt; {});</code>.  My code is full of these and I guess it causes errors to bot be caught so I could use some help understanding how to approach this better.</p>
  
  <p>Here's an exampe function:</p>
  
  <pre><code>updateUser = () =&gt; {
      return new Promise(async (resolve, reject) =&gt; {
          try {
              const url = "/getUser";
              const response = await fetch(url);
              if (response.ok) {
                  const user = await response.json();
                  //
                  // Do something with user object...
                  //
              } else {
                  console.log("response", response);
                  window.location = "/admin";
              }
              resolve();
          } catch (error) {
              console.log("error: ", error);
              reject(error);
          }
      });
  };
  </code></pre>