sindresorhus/eslint-plugin-unicorn

Rule proposal: Prefer `URLSearchParams` over `node:querystring` module

Closed

#1,701 opened on Jan 21, 2022

 (3 comments) (2 reactions) (0 assignees)JavaScript (468 forks)user submission
help wantednew rule

Repository metrics

Stars
 (5,022 stars)
PR merge metrics
 (Avg merge 1d 16h) (399 merged PRs in 30d)

Description

Description

The querystring module has been officially deprecated by Node.js for some time. The replacement recommended is URLSearchParams.

An autofix to convert common operations with the querystring module (ex. querystring.stringify) to their URLSearchParams equivalent would be useful as well.

Fail

import ... from 'querystring';
require('querystring');

Pass

// anything else

Contributor guide