File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ function fact(n) {
56
56
function getY ([x , y ]) {
57
57
return y;
58
58
}
59
+ getY ([" a" , " b" ]);
59
60
```
60
61
61
62
:::
@@ -89,6 +90,7 @@ myFunc = setTimeout(function() {
89
90
function getY ([, y ]) {
90
91
return y;
91
92
}
93
+ getY ([" a" , " b" ]);
92
94
```
93
95
94
96
:::
@@ -105,11 +107,18 @@ Note that `/* exported */` has no effect for any of the following:
105
107
106
108
The line comment ` // exported variableName ` will not work as ` exported ` is not line-specific.
107
109
108
- Examples of ** correct** code for ` /* exported variableName */ ` operation:
110
+ ``` js
111
+ /* exported global_var */
109
112
110
- ::: correct
113
+ var global_var = 42 ;
114
+ ```
115
+
116
+ Examples of ** correct** code for ` /* exported variableName */ ` operation with ` no-unused-vars ` :
117
+
118
+ ::: correct { "sourceType": "script" }
111
119
112
120
``` js
121
+ /* eslint no-unused-vars: "error"*/
113
122
/* exported global_var */
114
123
115
124
var global_var = 42 ;
@@ -386,11 +395,15 @@ Examples of **correct** code for the `{ "ignoreRestSiblings": true }` option:
386
395
387
396
``` js
388
397
/* eslint no-unused-vars: ["error", { "ignoreRestSiblings": true }]*/
398
+
389
399
// 'foo' and 'bar' were ignored because they have a rest property sibling.
390
- var { foo, ... coords } = data;
400
+ var { foo, ... rest } = data;
401
+ console .log (rest);
402
+
403
+ // OR
391
404
392
405
var bar;
393
- ({ bar, ... coords } = data);
406
+ ({ bar, ... rest } = data);
394
407
```
395
408
396
409
:::
You can’t perform that action at this time.
0 commit comments