eslint-plugin-vue icon indicating copy to clipboard operation
eslint-plugin-vue copied to clipboard

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

Open Ky6uk opened this issue 1 year ago • 3 comments

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 avatar Feb 07 '24 09:02 Ky6uk

Updated packages to the latest version.

Ky6uk avatar Apr 02 '24 11:04 Ky6uk

Same with this generic

image

daniluk4000 avatar Apr 03 '24 13:04 daniluk4000

I just opened #2484, feel free to contribute

sanderdewinter avatar Jun 25 '24 09:06 sanderdewinter