title: vue-router push route after axios post request
body: <p>When I wrote the following code:</p>
  <pre class="lang-js prettyprint-override"><code>axios.post('/user', { email: this.email })
  .then(
      (response) =&gt; {
        if (!response.data) {
          this.$router.push({ path: '/register', params: { user: defaultUser } });
        } else {
          this.$router.push({ path: '/login', params: { user: response.data } });
        }
      }, 
      (error) =&gt; {
        console.log(error);
      }
  );
  </code></pre>
  <p>The compiler shows error <code>@typescript-eslint/no-floating-promises: Promises must be handled appropriately or explicitly marked as ignored with the void operator.</code></p>
  <p>I also tried put a catch block after then block but it's still the same problem.</p>
  <pre class="lang-js prettyprint-override"><code>axios.post('/user', { email: this.email })
    .then((response) =&gt; {
      if (!response.data) {
        this.$router.push({ path: '/register', params: { user: defaultUser } });
      } else {
        this.$router.push({ path: '/login', params: { user: response.data } });
      }
    })
    .catch((error) =&gt; {
      console.log(error);
    });
  </code></pre>
  <p>I also figured out that the problem disappears when I comment out <code>this.$router.push</code>. So the problem might deal with redirecting route and resolving promise. Maybe it's better to rephrase the problem to '<strong>how to redirect route without leaving unresolved promise</strong>'? I hope I make the question clear.</p>