Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
legacy URL api has been deprecated in Node v11; while the API is still available in Node 12,
eslint-plugin-node
considers it as a deprecated api, thus will emit error if detected.WHATWG url is actually introduced back in Node v7, thus contrary to my previous PR (hexojs/eslint-config-hexo#19), it is supported in Node 8. The only thing is that Node 8 requires
const {URL} = require('url')
, whereas newer Node doesn't.Another noticeable difference is that WHATWG remove the port number if it corresponds to the protocol (e.g.
http
:80
,https
:443
), which explains the change of port number in the unit test.decode_url
is not refactored to the newer API for now due to a bug in Node 8,Once we drop Node 8, not only we can update
decode_url
, we can also removeconst {URL} = require('url')
line. It's ok to retain it, but it's not necessary.