pa11y / pa11y-ci

Pa11y CI is a CI-centric accessibility test runner, built using Pa11y
https://pa11y.org
GNU Lesser General Public License v3.0
515 stars 63 forks source link

eslint no-async-promise-executor on lib/pa11y-ci.js:43 #152

Closed josebolos closed 9 months ago

josebolos commented 3 years ago

After bumping the dependencies, eslint complains about no-async-promise-executor on lib/pa11y-ci.js:43. From the eslint docs:

The new Promise constructor accepts an executor function as an argument [...] The executor function can also be an async function. However, this is usually a mistake, for a few reasons:

  • If an async executor function throws an error, the error will be lost and won't cause the newly-constructed Promise to reject. This could make it difficult to debug and handle some errors.
  • If a Promise executor function is using await, this is usually a sign that it is not actually necessary to use the new Promise constructor, or the scope of the new Promise constructor can be reduced.

We probably want to make the pa11yCi function async for consistency with pa11y, and remove the additional promise if possible so the executor function doesn't need to be async.

Probably best done as part of the v3.0 release.

XhmikosR commented 2 years ago

@josebolos sorry for pinging you here, do you plan to cut a new release soon?

danyalaytekin commented 9 months ago

Hi @XhmikosR and @josebolos, I'm closing this issue since there's a commit since merged to main here that references it, and there were releases after the conversation was last touched. If I'm mistaken please reopen.