vuejs / eslint-plugin-vue

Official ESLint plugin for Vue.js
https://eslint.vuejs.org/
MIT License
4.47k stars 667 forks source link

`define-macros-order`: should ignore `declare` TypeScript declarations along with type definitions #2590

Closed andreww2012 closed 1 week ago

andreww2012 commented 3 weeks ago

Checklist

Tell us about your environment

What did you do?

Since declare TypeScript declarations only exist at compile time, I think they should be allowed to be placed before macros along with type definitions, meaning that the following code should not be reported:

<script setup lang="ts">
declare global {};

defineProps(/* ... */)
defineEmits(/* ... */)
</script>

Test on the rule page

What did you expect to happen?

What actually happened?

Repository to reproduce this issue