1
- # enforce either ` URLSearchParams ` or ` require("url").URLSearchParams ` (prefer-global/url)
1
+ # enforce either ` URLSearchParams ` or ` require("url").URLSearchParams ` (prefer-global/url-search-params )
2
2
3
3
The ` URLSearchParams ` class of ` url ` module is defined as a global variable.
4
4
@@ -18,7 +18,7 @@ This rule has a string option.
18
18
19
19
``` json
20
20
{
21
- "node/prefer-global/url" : [" error" , " always" | "never" ]
21
+ "node/prefer-global/url-search-params " : [" error" , " always" | "never" ]
22
22
}
23
23
```
24
24
@@ -30,7 +30,7 @@ This rule has a string option.
30
30
Examples of :-1 : ** incorrect** code for this rule:
31
31
32
32
``` js
33
- /* eslint node/prefer-global/url: [error]*/
33
+ /* eslint node/prefer-global/url-search-params : [error]*/
34
34
35
35
const { URLSearchParams } = require (" url" )
36
36
const u = new URLSearchParams (s)
@@ -39,7 +39,7 @@ const u = new URLSearchParams(s)
39
39
Examples of :+1 : ** correct** code for this rule:
40
40
41
41
``` js
42
- /* eslint node/prefer-global/url: [error]*/
42
+ /* eslint node/prefer-global/url-search-params : [error]*/
43
43
44
44
const u = new URLSearchParams (s)
45
45
```
@@ -49,15 +49,15 @@ const u = new URLSearchParams(s)
49
49
Examples of :-1 : ** incorrect** code for the ` "never" ` option:
50
50
51
51
``` js
52
- /* eslint node/prefer-global/url: [error, never]*/
52
+ /* eslint node/prefer-global/url-search-params : [error, never]*/
53
53
54
54
const u = new URLSearchParams (s)
55
55
```
56
56
57
57
Examples of :+1 : ** correct** code for the ` "never" ` option:
58
58
59
59
``` js
60
- /* eslint node/prefer-global/url: [error, never]*/
60
+ /* eslint node/prefer-global/url-search-params : [error, never]*/
61
61
62
62
const { URLSearchParams } = require (" url" )
63
63
const u = new URLSearchParams (s)
0 commit comments