prefer-global/url-search-params
UnreleasedConfiguration
rslint.config.ts
Rule details
Enforces consistent use of the global URLSearchParams or the URLSearchParams export from url and node:url. Module references include require(), process.getBuiltinModule(), and static imports and re-exports.
Options
This rule accepts one string option:
"always"(default): use the globalURLSearchParams."never": useURLSearchParamsfrom the module.
Enable Node.js globals in the configuration:
always
Examples of incorrect code:
Examples of correct code:
never
Examples of incorrect code:
Examples of correct code:
Global references respect configured globals and local bindings. For example, a function parameter named URLSearchParams is not reported with "never".
This rule has no automatic fix or suggestions.