@@ -58,6 +58,15 @@ function contextCompare(a, b, options) {
5858 let aProp = propName ( a ) ;
5959 let bProp = propName ( b ) ;
6060
61+ const aSortToEnd = shouldSortToEnd ( a ) ;
62+ const bSortToEnd = shouldSortToEnd ( b ) ;
63+ if ( aSortToEnd && ! bSortToEnd ) {
64+ return 1 ;
65+ }
66+ if ( ! aSortToEnd && bSortToEnd ) {
67+ return - 1 ;
68+ }
69+
6170 if ( options . reservedFirst ) {
6271 const aIsReserved = isReservedPropName ( aProp , options . reservedList ) ;
6372 const bIsReserved = isReservedPropName ( bProp , options . reservedList ) ;
@@ -106,17 +115,6 @@ function contextCompare(a, b, options) {
106115 return 0 ;
107116 }
108117
109- if ( options . commentbetween ) {
110- const aSortToEnd = shouldSortToEnd ( a ) ;
111- const bSortToEnd = shouldSortToEnd ( b ) ;
112- if ( aSortToEnd && ! bSortToEnd ) {
113- return 1 ;
114- }
115- if ( ! aSortToEnd && bSortToEnd ) {
116- return - 1 ;
117- }
118- }
119-
120118 const actualLocale = options . locale === 'auto' ? undefined : options . locale ;
121119
122120 if ( options . ignoreCase ) {
@@ -223,7 +221,6 @@ function generateFixerFunction(node, context, reservedList) {
223221 const noSortAlphabetically = configuration . noSortAlphabetically || false ;
224222 const reservedFirst = configuration . reservedFirst || false ;
225223 const locale = configuration . locale || 'auto' ;
226- const commentbetween = configuration . commentbetween || true ;
227224
228225 // Sort props according to the context. Only supports ignoreCase.
229226 // Since we cannot safely move JSXSpreadAttribute (due to potential variable overrides),
@@ -238,7 +235,6 @@ function generateFixerFunction(node, context, reservedList) {
238235 reservedFirst,
239236 reservedList,
240237 locale,
241- commentbetween,
242238 } ;
243239 const sortableAttributeGroups = getGroupsOfSortableAttributes ( attributes , context ) ;
244240 const sortedAttributeGroups = sortableAttributeGroups
0 commit comments