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/require-explicit-slots doesn't recognize interface passed to the macro #2398

Open
Ky6uk opened this issue Feb 7, 2024 · 3 comments · May be fixed by #2484
Open

vue/require-explicit-slots doesn't recognize interface passed to the macro #2398

Ky6uk opened this issue Feb 7, 2024 · 3 comments · May be fixed by #2484

Comments

@Ky6uk
Copy link

Ky6uk commented Feb 7, 2024

Tell us about your environment

  • ESLint version: 8.57.0
  • eslint-plugin-vue version: 9.24.0
  • @typescript-eslint/parser: 7.3.1,
  • Vue version: 3.4.15
  • Node version: 20.10.0
  • Operating System: Mac OS 14.2.1

Please show your full configuration:

module.exports = {
  parser: 'vue-eslint-parser',

  parserOptions: {
    parser: '@typescript-eslint/parser',
  },

  extends: ['plugin:vue/base'],

  rules: {
    'vue/require-explicit-slots': 'error',
  },
};

What did you do?

<template>
  <div>
    <slot />
  </div>
</template>

<script lang="ts" setup>
interface Slots {
  default: () => string;
}

defineSlots<Slots>();
</script>

What did you expect to happen?
No error reported.

What actually happened?

test.vue
  3:5  error  Slots must be explicitly defined  vue/require-explicit-slots

✖ 1 problem (1 error, 0 warnings)

Repository to reproduce this issue
https://stackblitz.com/edit/stackblitz-starters-reg1dy?file=test.vue

~$ npm run lint
@Ky6uk Ky6uk changed the title require-explicit-slots doesn't recognize interface passed to the macro vue/require-explicit-slots doesn't recognize interface passed to the macro Feb 7, 2024
@Ky6uk
Copy link
Author

Ky6uk commented Apr 2, 2024

Updated packages to the latest version.

@daniluk4000
Copy link

Same with this generic

image

@sanderdewinter
Copy link

I just opened #2484, feel free to contribute

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

Successfully merging a pull request may close this issue.

3 participants