Babel-eslint: no-unused-expressions shouldn't warn for await

Created on 2 Mar 2015  路  5Comments  路  Source: babel/babel-eslint

The following generates a warning when no-unused-expressions is on:

const response = funcThatReturnsAPromise();

await response; // no-unused-expressions warning
bug

Most helpful comment

I'm seeing this issue with babel-eslint v7.0.0, v7.2.0 and v7.2.1 - is there any special configuration needed to apply fix?

All 5 comments

Thanks!

I'm seeing this issue with babel-eslint v7.0.0, v7.2.0 and v7.2.1 - is there any special configuration needed to apply fix?

On http://eslint.org/demo/ this warning doesn't trigger, so this does appear to be a problem with babel-eslint.

I just ran into this as well. I have a lot of Selenium tests that have code similar to this:

await driver.actions().mouseMove(element).perform();

Agreed that this linting rule shouldn't warn for await. Or it should offer an appropriate configuration option.

Thank you for the issue. Now that @babel/eslint-parser has been released, we are making this repository read-only. If this is a change you would still like to advocate for, please reopen this in the babel/babel monorepo.

Was this page helpful?
0 / 5 - 0 ratings