Can anyone recommend a plugin or ESLint rule that can automatically sort types by assuming required fields come first, followed by optional fields?
Here's an example before:
type TExampleSorting = {
title?: string;
value?: number;
text: string;
}
And here's the desired order after sorting:
type TExampleSorting = {
text: string; <--- required first
title?: string;
value?: number;
};
Is there a way to achieve this automatic sorting once the TSX file is saved?
If you have any suggestions or solutions, I would greatly appreciate it!