Skip to content

Commit 38474cf

Browse files
cjihrigMyles Borins
authored and
Myles Borins
committed
tools: add arrow function rules to eslint
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]>
1 parent 0a44e6a commit 38474cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.eslintrc

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ rules:
7676
# list: http://eslint.org/docs/rules/#ecmascript-6
7777
## Suggest using 'const' wherever possible
7878
prefer-const: 2
79+
## Enforce parens around arrow function arguments
80+
arrow-parens: [2, "always"]
81+
## Require a space on each side of arrow operator
82+
arrow-spacing: [2, {"before": true, "after": true}]
83+
## Prevent using => in a condition where <= is intended
84+
no-arrow-condition: 2
7985

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

0 commit comments

Comments
 (0)