Skip to content

Commit

Permalink
Relax rule: no-unused-vars (allow using ...rest to omit variables)
Browse files Browse the repository at this point in the history
Fixes: standard/standard#800

The ignoreRestSiblings option is a boolean (default: false). Using a
Rest Property it is possible to “omit” properties from an object, but
by default the sibling properties are marked as “unused”. With this
option enabled the rest property’s siblings are ignored.

```js
// 'type' is ignored because it has a rest property sibling
var { type, ...coords } = data
```
  • Loading branch information
feross committed Mar 1, 2017
1 parent 972a12c commit 6d403c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eslintrc.json
Expand Up @@ -129,7 +129,7 @@
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }],
"no-unused-vars": ["error", { "vars": "all", "args": "none" }],
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }],
"no-use-before-define": ["error", { "functions": false, "classes": false, "variables": false }],
"no-useless-call": "error",
"no-useless-computed-key": "error",
Expand Down

0 comments on commit 6d403c1

Please sign in to comment.