Skip to content

Commit 7b9d9ad

Browse files
committed
Change "spaces" to "when"
1 parent c9e9ded commit 7b9d9ad

File tree

2 files changed

+103
-103
lines changed

2 files changed

+103
-103
lines changed

lib/rules/jsx-curly-spacing.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = {
3636
basicConfig: {
3737
type: 'object',
3838
properties: {
39-
spaces: {
39+
when: {
4040
enum: SPACING_VALUES
4141
},
4242
allowMultiline: {
@@ -78,30 +78,30 @@ module.exports = {
7878

7979
function normalizeConfig(configOrTrue, defaults, lastPass) {
8080
var config = configOrTrue === true ? {} : configOrTrue;
81-
var spaces = config.spaces || defaults.spaces;
81+
var when = config.when || defaults.when;
8282
var allowMultiline = has(config, 'allowMultiline') ? config.allowMultiline : defaults.allowMultiline;
8383
var spacing = config.spacing || {};
8484
var objectLiteralSpaces = spacing.objectLiterals || defaults.objectLiteralSpaces;
8585
if (lastPass) {
8686
// On the final pass assign the values that should be derived from others if they are still undefined
87-
objectLiteralSpaces = objectLiteralSpaces || spaces;
87+
objectLiteralSpaces = objectLiteralSpaces || when;
8888
}
8989

9090
return {
91-
spaces,
91+
when,
9292
allowMultiline,
9393
objectLiteralSpaces
9494
};
9595
}
9696

97-
var DEFAULT_SPACING = SPACING.never;
97+
var DEFAULT_WHEN = SPACING.never;
9898
var DEFAULT_ALLOW_MULTILINE = true;
9999
var DEFAULT_ATTRIBUTES = true;
100100

101101
var sourceCode = context.getSourceCode();
102102
var originalConfig = context.options[0] || {};
103103
var defaultConfig = normalizeConfig(originalConfig, {
104-
spaces: DEFAULT_SPACING,
104+
when: DEFAULT_WHEN,
105105
allowMultiline: DEFAULT_ALLOW_MULTILINE
106106
});
107107
var attributes = has(originalConfig, 'attributes') ? originalConfig.attributes : DEFAULT_ATTRIBUTES;
@@ -261,7 +261,7 @@ module.exports = {
261261
}
262262

263263
var isObjectLiteral = first.value === second.value;
264-
var spacing = isObjectLiteral ? config.objectLiteralSpaces : config.spaces;
264+
var spacing = isObjectLiteral ? config.objectLiteralSpaces : config.when;
265265
if (spacing === SPACING.always) {
266266
if (!sourceCode.isSpaceBetweenTokens(first, second)) {
267267
reportRequiredBeginningSpace(node, first);

0 commit comments

Comments
 (0)