Skip to content

Instantly share code, notes, and snippets.

@jonesnxt
Created October 12, 2022 04:19
Show Gist options
  • Save jonesnxt/b9f86d352e7723e0c5f0ca250bf9c51e to your computer and use it in GitHub Desktop.
Save jonesnxt/b9f86d352e7723e0c5f0ca250bf9c51e to your computer and use it in GitHub Desktop.
S('JSXOpeningElement').each((openingTag) => {
const attributes = openingTag.children('JSXAttribute');
const sortedAttributes = attributes
.map((attribute) => attribute.text())
.sort();
attributes.each((attribute, i) => attribute.text(sortedAttributes[i]));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment