-
-
Notifications
You must be signed in to change notification settings - Fork 679
vue/define-macros-order Ignore TS type sorting #2380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If you don't like the rule, please disable it. Otherwise, please explain what exactly you want to change. |
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. Thanks! |
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! |
Uh oh!
There was an error while loading. Please reload this page.
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: