You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @FloEdelmann, I’ve encountered a similar issue with this rule in my own project. The rule currently doesn’t take into account interfaces or aliases used in defineProps or defineEmits. Because of that, the macro declarations are separated from the types they rely on, which affects readability and organization.
I’d like to suggest enhancing the rule so that if an alias or interface is used in a macro, it is automatically grouped and moved together with the macro.
it is automatically grouped and moved together with the macro
I think that is too opinionated and too much for this rule. But ignoring TS interfaces and types before or between macros s probably a good idea. Pull requests are welcome for that!
What rule do you want to change?
ignore TS type sorting
Does this change cause the rule to produce more or fewer warnings?
How will the change be implemented? (New option, new default behavior, etc.)?
Please provide some example code that this change will affect:
// the rule will sort the following code interface Props { msg: string; } const props = defineProps<Props>(); interface Emits { (e: 'update'): void; } const emit = defineEmits<Emits>(); // after sorting const props = defineProps<Props>(); const emit = defineEmits<Emits>(); interface Props { msg: string } interface Emits { (e: 'update'): void; }
What does the rule currently do for this code?
What will the rule do after it's changed?
ignore sort TS type
Additional context
The text was updated successfully, but these errors were encountered: