mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 08:38:08 -05:00
[eslint-v2] add prefer-rest-params
This commit is contained in:
committed by
Jordan Harband
parent
c5b4f05879
commit
e1a087fbb1
@@ -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`.
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user