Skip to content

vue/require-explicit-slots does not work when type reference is imported #2785

Open
@Waxoussou

Description

@Waxoussou

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: 8.57
  • eslint-plugin-vue version: 10.0.0
  • Vue version: ^3.5
  • Node version: 18.20
  • Operating System: Ubuntu 24.10

Please show your full configuration:

// baseConfig
{
    root: true,
    env: {
        browser: true,
        es6: true,
        jest: true,
        node: true
    },
    extends: ["eslint:recommended", "plugin:vue/recommended", "@vue/prettier"],
    parser: "vue-eslint-parser",
    parserOptions: {
        parser: "@typescript-eslint/parser",
        ecmaVersion: 2020,
        sourceType: "module",
        ecmaFeatures: {
            jsx: true
        }
    },
    ignorePatterns: ["**/target/", "**/generated/"],
    overrides: [
        {
            files: ["**/*.ts", "**/*.tsx"],
            extends: [
                "eslint:recommended",
                "plugin:@typescript-eslint/eslint-recommended",
                "plugin:@typescript-eslint/recommended",
                "plugin:vue/recommended",
                "@vue/prettier"
            ]
        }
    ],
    rules: {
        "@typescript-eslint/no-unused-vars": ["warn"],
        "vue/multi-word-component-names": [
            "error",
            {
                ignores: []
            }
        ],
        "vue/require-explicit-slots": ["warn"]
    }
}

What did you do?

<script setup lang="ts">
import type {  BmButtonSlots } from "./button.type";
// ...
const slots = defineSlots<BmButtonSlots>();
</script>

<template>
    <BmButton>
        <slot v-else name="icon">
            <BmIcon v-if="icon" :icon="icon" />
        </slot>
        <span class="label-wrapper" :class="{ 'sr-only': isIconVariant }">
            <slot>
                {{ label }}
            </slot>
        </span>
    </BmButton>
</template>

What did you expect to happen?
should not warn about require-explicit-slot

What actually happened?

Slots must be explicitly defined.eslint[vue/require-explicit-slots](https://eslint.vuejs.org/rules/require-explicit-slots.html)

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reproNeed a repository that can reproduce the problem, or a link to DEMO.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy