title: Don't make functions within a loop, .then should return a value or throw
body: <p>I currently have a function I'm writing in javascript.  I am hitting domo's api and fetching each separate page of data sets until there is nothing else to grab inside of a do while loop.  ESLINTR is yelling at me however for the following: Don't make functions within a loop, and .then should return a value or throw an error.  I'm unsure of how to go about stifling these errors.  the code is as follows:</p>
  <pre><code>  const getExistingDatasets = async () =&gt; {
      let results = 0
      let offSet = -50
  
      do {
        offSet = offSet + 50
        await axios
          .get(`https://api.domo.com/v1/datasets`, {
            headers: {
              Authorization: auth,
              Accept: 'application/json'
            },
            params: {
              offset: offSet
            }
          })
          .then(r =&gt; {
            results = r.data.length
            const data = r.data
            data.map(data =&gt; getDatasetColumns(data.id, data.name))
            console.log(results)
          })
      } while (results &gt; 49)
    }
  
    getExistingDatasets()
  </code></pre>