Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[no-floating-promises] Should not report on async IIFEs #647

Copy link
Copy link
Closed
@sindresorhus

Description

@sindresorhus
Issue body actions

Repro

{
  "rules": {
    "@typescript-eslint/no-floating-promises": "error"
  }
}
(async () => {
	await something();
})();

Expected Result

I expected it not to report as it's an intentional action. It doesn't catch a mistake.

If you're not willing to add this exception by default, at least add an option to ignore async IIFEs.

Actual Result

It reports as a floating promise, which is technically correct, but not wanted behavior, at least from my perspective.

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 1.11.0
@typescript-eslint/parser 1.11.0
TypeScript 3.5.1
ESLint 5.16.0
node 8.16.0
npm 6.9.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.