Merged
Conversation
WHATWG URL can parse 'foo:bar/baz', thus need an additional check 'url.origin' to ensure it's not an external link
Contributor
Author
|
Added a test for 4964d80. |
SukkaW
approved these changes
Oct 23, 2019
This was referenced Oct 28, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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-nodeconsiders 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_urlis 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.