Sha256: e3b4c2df63ca160e5da78be1f81c1c7cdc7444975619e07b165e006c61b96594
Contents?: true
Size: 1.02 KB
Versions: 43
Compression:
Stored size: 1.02 KB
Contents
/** * @fileoverview disallow using an async function as a Promise executor * @author Teddy Katz */ "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = { meta: { docs: { description: "disallow using an async function as a Promise executor", category: "Possible Errors", recommended: false, url: "https://eslint.org/docs/rules/no-async-promise-executor" }, fixable: null, schema: [] }, create(context) { return { "NewExpression[callee.name='Promise'][arguments.0.async=true]"(node) { context.report({ node: context.getSourceCode().getFirstToken(node.arguments[0], token => token.value === "async"), message: "Promise executor functions should not be async." }); } }; } };
Version data entries
43 entries across 43 versions & 1 rubygems