Fix node/no-deprecated-api issues#9670
Conversation
56f0ff3 to
0ade0e3
Compare
app/scripts/lib/ens-ipfs/setup.js
Outdated
There was a problem hiding this comment.
The WHATWG URL object doesn't contain a path property (see this comparison). This path property from the deprecated API is equivalent to ${pathname}{search}.
It looks like pathname is what was originally intended here. In attemptResolve below it is concatenated with search. This implies that if search was non-empty, we would see it duplicated on these resolved URLs 🤔
I will test this theory, and fix this in a separate PR if so.
There was a problem hiding this comment.
I have confirmed that this is a bug. It is addressed in #9674
test/e2e/mock-3box/server.js
Outdated
There was a problem hiding this comment.
Seeing searchParams used reminded me of this: https://twitter.com/domenic/status/1257377082704900096
I was curious, so I checked to see if there was any behaviour change here between url and URL. It looks as though there is not. url parses the query string in the same weird way that URL does, at least with the examples listed in that PR description anyway. I didn't try the linked exhaustive list. Of course it doesn't matter here for this mock server anyway.
Refs MetaMask#9663 See [`node/no-deprecated-api`][1] for more information. This change enables `node/no-deprecated-api` and fixes the issues raised by the rule. [1]:https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-deprecated-api.md The change to the way that `punycode` is imported is to address the fact that third-party module is hidden by the built-in. This is a silly hack but it works.
0ade0e3 to
01e938a
Compare
Refs #9663
See
node/no-deprecated-apifor more information.This change enables
node/no-deprecated-apiand fixes the issues raised by the rule.The change to the way that
punycodeis imported is to workaround the fact that the 3rd-party version is hidden by the built-in version. Importing the file allows Node to understand that it should look innode_modules.