Skip to content

Commit 452928e

Browse files
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 3218dfb commit 452928e

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
@@ -86,6 +86,12 @@ rules:
8686
# list: http://eslint.org/docs/rules/#ecmascript-6
8787
## Suggest using 'const' wherever possible
8888
prefer-const: 2
89+
## Enforce parens around arrow function arguments
90+
arrow-parens: [2, "always"]
91+
## Require a space on each side of arrow operator
92+
arrow-spacing: [2, {"before": true, "after": true}]
93+
## Prevent using => in a condition where <= is intended
94+
no-arrow-condition: 2
8995

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

0 commit comments

Comments
 (0)