Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

vue/define-macros-order confusing error message #2940

Open
Labels
@ext

Description

@ext

Checklist

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

Tell us about your environment

  • ESLint version: 9.37.0
  • eslint-plugin-vue version: 10.5.0
  • Vue version: 3.5.22
  • Node version: 24.7.0
  • Operating System: Gentoo Linux

What did you do?

Given the following configuration (taken from therule documentat):

{rules:{"vue/define-macros-order":["error",{"order":["defineOptions","defineModel","defineProps","defineEmits",defineSlots"]},},}

And the following code (also from the documentation, but withdefineOptions moved to the top):

<script setup>defineOptions({/* ...*/})defineEmits(/* ...*/)constslots=defineSlots()defineProps(/* ...*/)constmodel=defineModel()</script>

What did you expect to happen?

defineModel should be above defineEmits

Since we know the order of the macros (from configuration) it would make sense if the error contained the expected ordering.

If we compare with thevue/order-in-components rule where we get an error similar to:

The "..." property should be above the "..." property on line [..]

What actually happened?

defineModel should be the first statement in<script setup> (after any potential import statements or type definitions).

Autofixing the error works,defineModel() is moved to the proper location. But the error is confusing and would make one try to move it to the top abovedefineOptions but doing that putsdefineOptions in the wrong order and you get a new error instead. If multiple of the macros are out-of-order (as might happen if you just turn this on) you get an endless supply of these confusing errors. Almost like a puzzle, you keep trying all kinds of combinations until you at some point happen to stumble upon the correct ordering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp