Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
* chore(eslint-plugin): enhance many rule descriptions

* wip

* Progress

* progress

* Fix lint:markdown

* Undo extension rule description nitpicking

* Remove rule attributes and other change

* Remove border-color

* codebasez

* Split out comma-spacing

* Remove sidebar.rules.js

* Update packages/eslint-plugin/docs/rules/

Co-authored-by: Zzzen <>

* Blurgh, comment

* Update packages/eslint-plugin/docs/rules/

Co-authored-by: Zzzen <>
12 contributors

Users who have contributed to this file

@JoshuaKGoldberg @bradzacher @armano2 @Josh-Cena @princjef @phaux @MaikoTan @jp7837 @BBosman @Zzzen @anikethsaha @a-tarasyuk
Require Promise-like statements to be handled appropriately.

🛑 This file is source code, not the primary documentation location! 🛑

See for documentation.

A "floating" Promise is one that is created without any code set up to handle any errors it might throw. Floating Promises can cause several issues, such as improperly sequenced operations, ignored Promise rejections, and more.

This rule reports when a Promise is created and not properly handled. Valid ways of handling a Promise-valued statement include:

  • awaiting it
  • returning it
  • Calling its .then() with two arguments
  • Calling its .catch() with one argument

:::tip no-floating-promises only detects unhandled Promise statements. See no-misused-promises for detecting code that provides Promises to logical locations such as if statements. :::



const promise = new Promise((resolve, reject) => resolve('value'));

async function returnsPromise() {
  return 'value';
returnsPromise().then(() => {});




const promise = new Promise((resolve, reject) => resolve('value'));
await promise;

async function returnsPromise() {
  return 'value';
  () => {},
  () => {},

Promise.reject('value').catch(() => {});

Promise.reject('value').finally(() => {});



This allows you to stop the rule reporting promises consumed with void operator. This can be a good way to explicitly mark a promise as intentionally not awaited.

Examples of correct code for this rule with { ignoreVoid: true }:

async function returnsPromise() {
  return 'value';
void returnsPromise();

void Promise.reject('value');

With this option set to true, and if you are using no-void, you should turn on the allowAsStatement option.


This allows you to skip checking of async IIFEs (Immediately Invocated function Expressions).

Examples of correct code for this rule with { ignoreIIFE: true }:

await(async function () {
  await res(1);

(async function () {
  await res(1);

When Not To Use It

If you do not use Promise-like values in your codebase, or want to allow them to remain unhandled.

Related To