File tree Expand file tree Collapse file tree 2 files changed +613
-10
lines changed Expand file tree Collapse file tree 2 files changed +613
-10
lines changed Original file line number Diff line number Diff line change @@ -61,19 +61,39 @@ module.exports = {
61
61
}
62
62
} ,
63
63
64
- allOf : [ {
65
- $ref : '#/definitions/basicConfig'
64
+ oneOf : [ {
65
+ allOf : [ {
66
+ $ref : '#/definitions/basicConfig'
67
+ } , {
68
+ type : 'object' ,
69
+ properties : {
70
+ attributes : {
71
+ $ref : '#/definitions/basicConfigOrBoolean'
72
+ } ,
73
+ children : {
74
+ $ref : '#/definitions/basicConfigOrBoolean'
75
+ }
76
+ }
77
+ } ]
66
78
} , {
67
- type : 'object' ,
68
- properties : {
69
- attributes : {
70
- $ref : '#/definitions/basicConfigOrBoolean'
71
- } ,
72
- children : {
73
- $ref : '#/definitions/basicConfigOrBoolean'
79
+ enum : SPACING_VALUES
80
+ } ]
81
+ } , {
82
+ type : 'object' ,
83
+ properties : {
84
+ allowMultiline : {
85
+ type : 'boolean'
86
+ } ,
87
+ spacing : {
88
+ type : 'object' ,
89
+ properties : {
90
+ objectLiterals : {
91
+ enum : SPACING_VALUES
92
+ }
74
93
}
75
94
}
76
- } ]
95
+ } ,
96
+ additionalProperties : false
77
97
} ]
78
98
} ,
79
99
@@ -104,6 +124,9 @@ module.exports = {
104
124
105
125
var sourceCode = context . getSourceCode ( ) ;
106
126
var originalConfig = context . options [ 0 ] || { } ;
127
+ if ( SPACING_VALUES . indexOf ( originalConfig ) !== - 1 ) {
128
+ originalConfig = Object . assign ( { when : context . options [ 0 ] } , context . options [ 1 ] ) ;
129
+ }
107
130
var defaultConfig = normalizeConfig ( originalConfig , {
108
131
when : DEFAULT_WHEN ,
109
132
allowMultiline : DEFAULT_ALLOW_MULTILINE
You can’t perform that action at this time.
0 commit comments