Skip to content

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

Closed
@andreww2012

Description

@andreww2012

Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have read the FAQ and my problem is not listed.

Tell us about your environment

  • ESLint version: 9.13.0
  • eslint-plugin-vue version: 9.30.3
  • Vue version: 3.5.12
  • Node version:
  • Operating System:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions