File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ function fact(n) {
5656function getY ([x , y ]) {
5757 return y;
5858}
59+ getY ([" a" , " b" ]);
5960```
6061
6162:::
@@ -89,6 +90,7 @@ myFunc = setTimeout(function() {
8990function getY ([, y ]) {
9091 return y;
9192}
93+ getY ([" a" , " b" ]);
9294```
9395
9496:::
@@ -105,11 +107,18 @@ Note that `/* exported */` has no effect for any of the following:
105107
106108The line comment ` // exported variableName ` will not work as ` exported ` is not line-specific.
107109
108- Examples of ** correct** code for ` /* exported variableName */ ` operation:
110+ ``` js
111+ /* exported global_var */
109112
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" }
111119
112120``` js
121+ /* eslint no-unused-vars: "error"*/
113122/* exported global_var */
114123
115124var global_var = 42 ;
@@ -386,11 +395,15 @@ Examples of **correct** code for the `{ "ignoreRestSiblings": true }` option:
386395
387396``` js
388397/* eslint no-unused-vars: ["error", { "ignoreRestSiblings": true }]*/
398+
389399// '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
391404
392405var bar;
393- ({ bar, ... coords } = data);
406+ ({ bar, ... rest } = data);
394407```
395408
396409:::
You can’t perform that action at this time.
0 commit comments