sindresorhus/eslint-plugin-unicorn

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

Open

#1,701 创建于 2022年1月21日

在 GitHub 查看
 (3 评论) (2 反应) (0 负责人)JavaScript (5,022 star) (468 fork)user submission
help wantednew rule

描述

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

贡献者指南