n/prefer-global/url-search-params
eslint-plugin-n
No autofix
eslint.config.js
import n from "eslint-plugin-n";
export default [
{
plugins: { n },
rules: {
"n/prefer-global/url-search-params": "error",
},
},
];Enforce either URLSearchParams or require("url").URLSearchParams
const { URLSearchParams } = require("url")
const u = new URLSearchParams(s)const u = new URLSearchParams(s)const u = new URLSearchParams(s)const { URLSearchParams } = require("url")
const u = new URLSearchParams(s)Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
n/prefer-global/url-search-params
eslint-plugin-n
import n from "eslint-plugin-n";
export default [
{
plugins: { n },
rules: {
"n/prefer-global/url-search-params": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce using node:assert/strict instead of node:assert.
Enforce either global timer functions or require("timers")
Enforce either TextEncoder or require("util").TextEncoder