Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Docs: Overhaul no-floating-promise messages and docs #8088

Open
Assignees
kirkwaiblinger
Labels
documentationDocumentation ("docs") that needs adding/updatingteam assignedA member of the typescript-eslint team should work on this.
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Before You File a Documentation Request Please Confirm You Have Done The Following...

Suggested Changes

Right now,@typescript-eslint/no-floating-promises logs quite a mouthful for its messages:

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator.

So much text! Longer messages are less likely to be read by users - especially "error" (or "warning") messages like this one.

In addition, it's also missing the point that storing the Promise in a variable is considered an acceptable workaround by the rule (assuming you have unused variable detection enabled).#8046 is an example of a discussion asking about that.

This is a nuanced area. See replies to:https://twitter.com/flybayer/status/1469098848958222337,https://twitter.com/threepointone/status/1471458830626299911,https://twitter.com/nandafyi/status/1736164705448956388, and other threads from searching onno-floating-promises). I think we should rework the rule a bit to coach/encourage developers into treating the nuance with care:

  • Make the error message much shorter (so folks will actually read the whole thing), and perhaps encourage them to read the docs for more info
  • Mention the unused variable allowance in the docs
  • Link to a blog post explaining how to enable our Promise/Thenable-area rules (perhaps a separate issue?)

Affected URL(s)

https://typescript-eslint.io/rules/no-floating-promises

Metadata

Metadata

Labels

documentationDocumentation ("docs") that needs adding/updatingteam assignedA member of the typescript-eslint team should work on this.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp