square / eslint-plugin-square

An ESLint plugin containing custom JavaScript, Ember, React, TypeScript rules and configurations tailored to Square's needs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ignore intentionally-stored promises in `require-await-function` rule?

bmish opened this issue · comments

Saw this in a test:

// simulate two clicks
const promise1 = click('[data-test-pricing-section-cta-primary="plus"]'); // eslint-disable-line square/require-await-function
const promise2 = click('[data-test-pricing-section-cta-primary="plus"]'); // eslint-disable-line square/require-await-function
await Promise.all([promise1, promise2]);

If we know we're trying to store and use the promises like this, we could potentially update the rule to ignore these lines.

I'm filing this for the record but closing it since it's a low-priority edge case.