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 = {
6161 }
6262 } ,
6363
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+ } ]
6678 } , {
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+ }
7493 }
7594 }
76- } ]
95+ } ,
96+ additionalProperties : false
7797 } ]
7898 } ,
7999
@@ -104,6 +124,9 @@ module.exports = {
104124
105125 var sourceCode = context . getSourceCode ( ) ;
106126 var originalConfig = context . options [ 0 ] || { } ;
127+ if ( SPACING_VALUES . indexOf ( originalConfig ) !== - 1 ) {
128+ originalConfig = Object . assign ( { when : context . options [ 0 ] } , context . options [ 1 ] ) ;
129+ }
107130 var defaultConfig = normalizeConfig ( originalConfig , {
108131 when : DEFAULT_WHEN ,
109132 allowMultiline : DEFAULT_ALLOW_MULTILINE
You can’t perform that action at this time.
0 commit comments