Skip to content

Commit

Permalink
tools: add arrow function rules to eslint
Browse files Browse the repository at this point in the history
This commit enables the following rules:
* arrow-parens - requires parens around arrow function arguments
* arrow-spacing - ensures a space on each side of the =>
* no-arrow-condition - prevents accidental use of => in cases
where the user really intends to use <=

PR-URL: #4813
Reviewed-By: Rod Vagg <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Saúl Ibarra Corretgé <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Roman Reiss <[email protected]>
  • Loading branch information
cjihrig authored and rvagg committed Feb 9, 2016
1 parent ecc7976 commit a3a0cf6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ rules:
# list: http://eslint.org/docs/rules/#ecmascript-6
## Suggest using 'const' wherever possible
prefer-const: 2
## Enforce parens around arrow function arguments
arrow-parens: [2, "always"]
## Require a space on each side of arrow operator
arrow-spacing: [2, {"before": true, "after": true}]
## Prevent using => in a condition where <= is intended
no-arrow-condition: 2

# Strict Mode
# list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode
Expand Down

0 comments on commit a3a0cf6

Please sign in to comment.