Skip to content

Commit 408e1b1

Browse files
committed
Add the "children" property of the config
1 parent 65135b8 commit 408e1b1

File tree

2 files changed

+654
-74
lines changed

2 files changed

+654
-74
lines changed

lib/rules/jsx-curly-spacing.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ module.exports = {
6868
properties: {
6969
attributes: {
7070
$ref: '#/definitions/basicConfigOrBoolean'
71+
},
72+
children: {
73+
$ref: '#/definitions/basicConfigOrBoolean'
7174
}
7275
}
7376
}]
@@ -97,6 +100,7 @@ module.exports = {
97100
var DEFAULT_WHEN = SPACING.never;
98101
var DEFAULT_ALLOW_MULTILINE = true;
99102
var DEFAULT_ATTRIBUTES = true;
103+
var DEFAULT_CHILDREN = false;
100104

101105
var sourceCode = context.getSourceCode();
102106
var originalConfig = context.options[0] || {};
@@ -106,6 +110,8 @@ module.exports = {
106110
});
107111
var attributes = has(originalConfig, 'attributes') ? originalConfig.attributes : DEFAULT_ATTRIBUTES;
108112
var attributesConfig = attributes ? normalizeConfig(attributes, defaultConfig, true) : null;
113+
var children = has(originalConfig, 'children') ? originalConfig.children : DEFAULT_CHILDREN;
114+
var childrenConfig = children ? normalizeConfig(children, defaultConfig, true) : null;
109115

110116
// --------------------------------------------------------------------------
111117
// Helpers
@@ -247,7 +253,8 @@ module.exports = {
247253
break;
248254

249255
case 'JSXElement':
250-
return;
256+
config = childrenConfig;
257+
break;
251258

252259
default:
253260
return;

0 commit comments

Comments
 (0)