Skip to content

Commit

Permalink
Move the first option into the config object
Browse files Browse the repository at this point in the history
Use the "spaces" name.
  • Loading branch information
fatfisz committed Jun 11, 2017
1 parent 8e547ea commit 0f0ab21
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 80 deletions.
12 changes: 6 additions & 6 deletions lib/rules/jsx-curly-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ module.exports = {
fixable: 'code',

schema: [{
enum: SPACING_VALUES
}, {
type: 'object',
properties: {
spaces: {
enum: SPACING_VALUES
},
allowMultiline: {
type: 'boolean'
},
Expand All @@ -47,8 +48,7 @@ module.exports = {
}
}
}
},
additionalProperties: false
}
}]
},

Expand All @@ -58,8 +58,8 @@ module.exports = {
var DEFAULT_ALLOW_MULTILINE = true;

var sourceCode = context.getSourceCode();
var baseSpacing = context.options[0] || DEFAULT_SPACING;
var config = context.options[1] || {};
var config = context.options[0] || {};
var baseSpacing = config.spaces || DEFAULT_SPACING;
var multiline = has(config, 'allowMultiline') ? config.allowMultiline : DEFAULT_ALLOW_MULTILINE;
var spacingConfig = config.spacing || {};
var objectLiteralSpacing = spacingConfig.objectLiterals || baseSpacing;
Expand Down
Loading

0 comments on commit 0f0ab21

Please sign in to comment.