]>
git.proxmox.com Git - pve-eslint.git/blob - eslint/lib/rules/no-async-promise-executor.js
f940f152e3cecdb877870655dda09d98a670cbdc
2 * @fileoverview disallow using an async function as a Promise executor
7 //------------------------------------------------------------------------------
9 //------------------------------------------------------------------------------
11 /** @type {import('../shared/types').Rule} */
17 description
: "disallow using an async function as a Promise executor",
19 url
: "https://eslint.org/docs/rules/no-async-promise-executor"
25 async
: "Promise executor functions should not be async."
31 "NewExpression[callee.name='Promise'][arguments.0.async=true]"(node
) {
33 node
: context
.getSourceCode().getFirstToken(node
.arguments
[0], token
=> token
.value
=== "async"),