[eslint-v2] add prefer-rest-params

This commit is contained in:
Harrison Shoff
2016-02-14 18:45:44 -08:00
committed by Jordan Harband
parent c5b4f05879
commit e1a087fbb1
2 changed files with 4 additions and 1 deletions

View File

@@ -581,7 +581,7 @@ Other Style Guides
```
<a name="es6-rest"></a>
- [7.6](#7.6) <a name='7.6'></a> Never use `arguments`, opt to use rest syntax `...` instead.
- [7.6](#7.6) <a name='7.6'></a> Never use `arguments`, opt to use rest syntax `...` instead. [prefer-rest-params](http://eslint.org/docs/rules/prefer-rest-params)
> Why? `...` is explicit about which arguments you want pulled. Plus rest arguments are a real Array and not Array-like like `arguments`.

View File

@@ -57,6 +57,9 @@ module.exports = {
'prefer-spread': 0,
// suggest using Reflect methods where applicable
'prefer-reflect': 0,
// use rest parameters instead of arguments
// http://eslint.org/docs/rules/prefer-rest-params
'prefer-rest-params': 2,
// suggest using template literals instead of string concatenation
// http://eslint.org/docs/rules/prefer-template
'prefer-template': 2,