Skip to content
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

vue/define-macros-order does not support multiple defineModel macro calls #2371

Closed
2 tasks done
hendrikheil opened this issue Jan 19, 2024 · 0 comments · Fixed by #2386
Closed
2 tasks done

vue/define-macros-order does not support multiple defineModel macro calls #2371

hendrikheil opened this issue Jan 19, 2024 · 0 comments · Fixed by #2386
Labels

Comments

@hendrikheil
Copy link
Contributor

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: v8.56.0
  • eslint-plugin-vue version: v9.20.1
  • Vue version: v3.4.15
  • Node version: v18.18.2
  • Operating System: MacOS 14.1

Please show your full configuration:

module.exports = {
  extends: [
    'plugin:vue/base',
  ],

  parserOptions: {
    parser: {
      js: 'espree',
      jsx: 'espree',

      ts: '@typescript-eslint/parser',
      tsx: '@typescript-eslint/parser',
    },
  },
  rules: {
    "vue/define-macros-order": ["error", {
      order: ['defineOptions', 'defineModel', 'defineProps', 'defineEmits', 'defineSlots'],
      defineExposeLast: true,
    }]
  },
};

What did you do?
I defined two defineModel calls as is allowed in vue 3.4.

What did you expect to happen?
Both defineModel calls are treated the first macro "group" and they are sorted alphabetically.

What actually happened?

npm run lint:ts


> vue-eslint-multiple-define-model@1.0.0 lint:ts
> eslint --ext .vue .


/Users/hendrik/projects/stafftastic/vue-eslint-multiple-define-model/reproduction.vue
  9:1  error  defineModel should be the first statement in `<script setup>` (after any potential import statements or type definitions)  vue/define-macros-order

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

Repository to reproduce this issue

https://github.com/hendrikheil/vue-eslint-multiple-define-model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants