The no-unnecessary-polyfills
rule complains about usage of promise.withresolvers
package on Node.js 20 even though the native Promise.withResolvers
is not available. According to MDN, it is only available since Node 22.0.0.
no-unnecessary-polyfills
Here's my rule config:
"unicorn/no-unnecessary-polyfills": [
"error",
{ targets: "node 20.15.0" },
],
Here's the engines
part on package.json
:
"engines": {
"node": "^20.15.0",
"pnpm": "^9.4.0"
},
And there's a piece of code that triggers an error.
import withResolvers from "promise.withresolvers"; // Use built-in instead. eslint (unicorn/no-unnecessary-polyfills)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too