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

Fix for `require-await-function` overly aggressive

fengb opened this issue · comments

There are a few cases where I ran --fix on the codebase:

// before
const promise = render();

// after
const promise = await render();

Assignment to a "require await" function probably should not be auto fixed. It's preferable here to manually disable the rule since it is actually testing the result of the promise.

I think the correct solution is only applying the fix on top level function calls.

So you think we should still flag a violation on assignment but don't autofix it?