From bd8d3aa1f6a0ce0ef8d7e9047a1cd8f806277284 Mon Sep 17 00:00:00 2001 From: Robert Anderson Date: Tue, 9 Jan 2018 10:00:34 +1100 Subject: [PATCH] Force JSX expressions to have spacing The `react/jsx-curly-spacing` rule applies only to curly brackets used in attributes. We can force curly brakcets used in children to have spacing by setting children: true on the rule. --- .eslintrc.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index 5b848d9c369920..1149e83f893db1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -152,7 +152,10 @@ "prefer-const": "error", "quote-props": [ "error", "as-needed" ], "react/display-name": "off", - "react/jsx-curly-spacing": [ "error", "always" ], + "react/jsx-curly-spacing": [ "error", { + "when": "always", + "children": true + } ], "react/jsx-equals-spacing": "error", "react/jsx-indent": [ "error", "tab" ], "react/jsx-indent-props": [ "error", "tab" ],