Skip to content

feat: add no-deprecated-url-parse lint rule#55

Open
danielchen0 wants to merge 3 commits intomainfrom
danielchen0/no-deprecated-url-parse
Open

feat: add no-deprecated-url-parse lint rule#55
danielchen0 wants to merge 3 commits intomainfrom
danielchen0/no-deprecated-url-parse

Conversation

@danielchen0
Copy link
Collaborator

Summary

  • Adds no-deprecated-url-parse rule that detects usage of url.parse(), deprecated in Node.js
  • Suggests using new URL(input, base) instead
  • Handles default imports, namespace imports (import * as url), and named imports (import { parse }) from both url and node:url
  • 619+ deprecation warnings/week in production
  • Platform: backend only

Test plan

Scenario Expected
url.parse('...') with default import Warning flagged
url.parse('...') with import * as url from 'node:url' Warning flagged
parse('...') with import { parse } from 'url' Warning flagged
urlParse('...') with import { parse as urlParse } Warning flagged
new URL('...') No warning
url.format(...) No warning
parse() from path module No warning

Detects usage of url.parse() which is deprecated in Node.js. Suggests using
'new URL(input, base)' instead. Handles default imports, namespace imports,
and named imports from 'url' and 'node:url'. 619+ deprecation warnings/week.
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

Successfully merging this pull request may close these issues.

1 participant