Splits them into an array by the new-line character
Sorts the array by ascending order of string length
Replaces selected text with the sorted text
Formats the selected text as well, so that everything looks neat!
Disclaimer
Please note that this will work only for groups of single lines i.e.,
the selected text should not contain any code that spans more than a single line
For example, the below snippet of code cannot be used with this plugin.
// Reordering this will break, since the code spans more than one line
let lines = selectedText
.split('\n')
.filter((line) => line)
.map((x) => x.id = 6);
Also, please make sure to select entire lines i.e., starting from the first character till the last!