diff --git a/packages/eslint-plugin/src/rules/consistent-device-config-property-order.ts b/packages/eslint-plugin/src/rules/consistent-device-config-property-order.ts index 34d30146ad1d..28d530ffa930 100644 --- a/packages/eslint-plugin/src/rules/consistent-device-config-property-order.ts +++ b/packages/eslint-plugin/src/rules/consistent-device-config-property-order.ts @@ -80,8 +80,8 @@ export const consistentDeviceConfigPropertyOrder: JSONCRule.RuleModule = { 0, withRanges[0].property.loc.start.column, ); - - const desiredOrder = propsWithComments.toSorted((a, b) => + // TODO: Change to .toSorted() once on node 20. + const desiredOrder = [...propsWithComments].sort((a, b) => a.index - b.index ).map((prop) => { const start = Math.min(