1- # enforce either ` URLSearchParams ` or ` require("url").URLSearchParams ` (prefer-global/url)
1+ # enforce either ` URLSearchParams ` or ` require("url").URLSearchParams ` (prefer-global/url-search-params )
22
33The ` URLSearchParams ` class of ` url ` module is defined as a global variable.
44
@@ -18,7 +18,7 @@ This rule has a string option.
1818
1919``` json
2020{
21- "node/prefer-global/url" : [" error" , " always" | "never" ]
21+ "node/prefer-global/url-search-params " : [" error" , " always" | "never" ]
2222}
2323```
2424
@@ -30,7 +30,7 @@ This rule has a string option.
3030Examples of :-1 : ** incorrect** code for this rule:
3131
3232``` js
33- /* eslint node/prefer-global/url: [error]*/
33+ /* eslint node/prefer-global/url-search-params : [error]*/
3434
3535const { URLSearchParams } = require (" url" )
3636const u = new URLSearchParams (s)
@@ -39,7 +39,7 @@ const u = new URLSearchParams(s)
3939Examples of :+1 : ** correct** code for this rule:
4040
4141``` js
42- /* eslint node/prefer-global/url: [error]*/
42+ /* eslint node/prefer-global/url-search-params : [error]*/
4343
4444const u = new URLSearchParams (s)
4545```
@@ -49,15 +49,15 @@ const u = new URLSearchParams(s)
4949Examples of :-1 : ** incorrect** code for the ` "never" ` option:
5050
5151``` js
52- /* eslint node/prefer-global/url: [error, never]*/
52+ /* eslint node/prefer-global/url-search-params : [error, never]*/
5353
5454const u = new URLSearchParams (s)
5555```
5656
5757Examples of :+1 : ** correct** code for the ` "never" ` option:
5858
5959``` js
60- /* eslint node/prefer-global/url: [error, never]*/
60+ /* eslint node/prefer-global/url-search-params : [error, never]*/
6161
6262const { URLSearchParams } = require (" url" )
6363const u = new URLSearchParams (s)
0 commit comments