Skip to content

define-macros-order: option to allow compile only TypeScript code between macrosΒ #2978

@andreww2012

Description

@andreww2012

What rule do you want to change?

define-macros-order

Does this change cause the rule to produce more or fewer warnings?

Less

How will the change be implemented? (New option, new default behavior, etc.)?

Sometimes it's useful to put some types between macro definitions (for example, if they're only used inside the macro following the type declaration):

<script setup lang="ts">
defineProps(/* ... */)

type Foo = 'bar';

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

However, currently any type declaration between macros are disallowed by this rule. It would be nice to introduce an option, say allowTypesBetweenMacros, to control whether non-runtime TS code will be allowed between macros.

Please provide some example code that this change will affect:

See above

What does the rule currently do for this code?

Reports

What will the rule do after it's changed?

Will not report

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions