camacho/format-package

Flag - option to "not sort"

Closed this issue · 2 comments

Hi @camacho

I really like the flexility and the power of the package.
I want to leverage it for formatting OpenAPI JSON spec files.

I want to prevent the "alphabetize" option, since the default properties should remain unsorted.

Is there an easy way to to do this?

A change would be required to the logic that identifies keys in the transforms function and then processes unfound keys with alphabetize. A default behavior function could be provided as an alternative to the alphabetize one.

See #126 - it is now possible to provide a custom default function using a * property in transformations