@@ -36,7 +36,7 @@ module.exports = {
36
36
basicConfig : {
37
37
type : 'object' ,
38
38
properties : {
39
- spaces : {
39
+ when : {
40
40
enum : SPACING_VALUES
41
41
} ,
42
42
allowMultiline : {
@@ -78,30 +78,30 @@ module.exports = {
78
78
79
79
function normalizeConfig ( configOrTrue , defaults , lastPass ) {
80
80
var config = configOrTrue === true ? { } : configOrTrue ;
81
- var spaces = config . spaces || defaults . spaces ;
81
+ var when = config . when || defaults . when ;
82
82
var allowMultiline = has ( config , 'allowMultiline' ) ? config . allowMultiline : defaults . allowMultiline ;
83
83
var spacing = config . spacing || { } ;
84
84
var objectLiteralSpaces = spacing . objectLiterals || defaults . objectLiteralSpaces ;
85
85
if ( lastPass ) {
86
86
// 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 ;
88
88
}
89
89
90
90
return {
91
- spaces ,
91
+ when ,
92
92
allowMultiline,
93
93
objectLiteralSpaces
94
94
} ;
95
95
}
96
96
97
- var DEFAULT_SPACING = SPACING . never ;
97
+ var DEFAULT_WHEN = SPACING . never ;
98
98
var DEFAULT_ALLOW_MULTILINE = true ;
99
99
var DEFAULT_ATTRIBUTES = true ;
100
100
101
101
var sourceCode = context . getSourceCode ( ) ;
102
102
var originalConfig = context . options [ 0 ] || { } ;
103
103
var defaultConfig = normalizeConfig ( originalConfig , {
104
- spaces : DEFAULT_SPACING ,
104
+ when : DEFAULT_WHEN ,
105
105
allowMultiline : DEFAULT_ALLOW_MULTILINE
106
106
} ) ;
107
107
var attributes = has ( originalConfig , 'attributes' ) ? originalConfig . attributes : DEFAULT_ATTRIBUTES ;
@@ -261,7 +261,7 @@ module.exports = {
261
261
}
262
262
263
263
var isObjectLiteral = first . value === second . value ;
264
- var spacing = isObjectLiteral ? config . objectLiteralSpaces : config . spaces ;
264
+ var spacing = isObjectLiteral ? config . objectLiteralSpaces : config . when ;
265
265
if ( spacing === SPACING . always ) {
266
266
if ( ! sourceCode . isSpaceBetweenTokens ( first , second ) ) {
267
267
reportRequiredBeginningSpace ( node , first ) ;
0 commit comments