Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy URL is not deprecated anymore - node/no-deprecated-api #339

Open
jjspace opened this issue Aug 26, 2022 · 3 comments
Open

Legacy URL is not deprecated anymore - node/no-deprecated-api #339

jjspace opened this issue Aug 26, 2022 · 3 comments

Comments

@jjspace
Copy link

jjspace commented Aug 26, 2022

It seems that url.parse and others as part of the Legacy URL API are no longer deprecated as of node v14.17.0. I don't believe they should trigger node/no-deprecated-api.

This was specifically an issue in our projects given than url.parse(path) is not the same as new URL(path) when the path is relative. See issues for more:

@jimmywarting
Copy link

Still do not think that ppl should use url.parse as it's not as well cross env. friendly.
new URL() exist in every env. url.parse don't (it requires a polyfill)

@jjspace
Copy link
Author

jjspace commented Jan 5, 2023

It's fine if developers/teams decide not to use url.parse as a matter of best practice but the fact remains that it is not actually deprecated and thus should not trigger the no-deprecated-api rule. This is important because new URL() is not a direct replacement for url.parse in certain circumstances (see above) and the no-deprecated-api error forced us to change code that didn't technically need changed for a deprecated function.

@voxpelli
Copy link

eslint-plugin-n is the maintained version of this module.

We switched to it in eg. eslint-config-standard / standard and it is maintained by me and other members of the official ESLint community organization.

Try that module out and if it isn't fixed there, then open a new issue in that project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants