Last 12 weeks · 0 commits
4 of 6 standards met
Repository: sindresorhus/p-defer. Description: Create a deferred promise Stars: 84, Forks: 9. Primary language: JavaScript. Languages: JavaScript (57.2%), TypeScript (42.8%). License: MIT. Latest release: v4.0.1 (1y ago). Open PRs: 0, open issues: 0. Last activity: 5mo ago. Community health: 85%. Top contributors: sindresorhus, BendingBender, coreyfarrell, callmehiphop, JacobLey, Richienb.
If a user attempts to destructure the defer object, it can get flagged by @typescript-eslint/unbound-method. The actual implementation does not at all require a reference to this (+ is the native value provided in the promise callback), but the typescript definitions do not make it clear, and since it is being pulled off a object, eslint thinks it _might_ need a reference to . Example: (This example is an oversimplification, and not a great place to legitimately use this library, but enough to recreate the issue) The solution is to just update the typing to explicitly declare the as ignorable ().