File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,12 +12,13 @@ const expandProps = (position = 'end') => () => ({
1212 props . name = 'props'
1313 props . spread = true
1414 if ( position === 'start' ) {
15- path . node . attributes . unshift ( props )
15+ path . node . attributes = [ props , ...path . node . attributes ]
16+ path . replace ( path . node )
1617 }
1718 if ( position === 'end' ) {
18- path . node . attributes . push ( props )
19+ path . node . attributes = [ ...path . node . attributes , props ]
20+ path . replace ( path . node )
1921 }
20- path . replace ( path . node )
2122 }
2223 } ,
2324 } ,
Original file line number Diff line number Diff line change @@ -24,13 +24,6 @@ export const settings = [
2424 group : 'global' ,
2525 default : false ,
2626 } ,
27- {
28- label : 'Expand props' ,
29- name : 'expandProps' ,
30- type : 'boolean' ,
31- group : 'global' ,
32- default : true ,
33- } ,
3427 {
3528 label : 'Ref' ,
3629 name : 'ref' ,
@@ -45,6 +38,15 @@ export const settings = [
4538 group : 'global' ,
4639 default : false ,
4740 } ,
41+ {
42+ label : 'Expand props' ,
43+ name : 'expandProps' ,
44+ type : 'enum' ,
45+ values : [ 'start' , 'end' , 'none' ] ,
46+ group : 'global' ,
47+ default : 'end' ,
48+ transform : value => value === 'none' ? false : value ,
49+ } ,
4850 {
4951 label : 'Replace attributes value' ,
5052 name : 'replaceAttrValues' ,
You can’t perform that action at this time.
0 commit comments