Skip to content

vue/no-deprecated-filter triggers for dynamic generic components #2783

@darioackermann

Description

@darioackermann

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: 9.30.1
  • eslint-plugin-vue version: 10.3.0
  • Vue version: 3.5.17
  • Node version: 20.19.3
  • Operating System: Windows

Please show your full configuration:

import pluginVue from 'eslint-plugin-vue'
import {
  defineConfigWithVueTs,
  vueTsConfigs,
} from '@vue/eslint-config-typescript'

export default defineConfigWithVueTs(
    // chosen vue defaults
    pluginVue.configs['flat/recommended'],
    vueTsConfigs.recommended,
)

What did you do?

Attempting to include a dynamic generic component

GenCo.vue

<template>
  This is my generic component
</template>
<script setup lang="ts" generic="T">
</script>

App.vue

<script setup lang="ts">
import GenCo from './components/GenCo.vue'

type User = {
  key: 'User'
  name: string
  age: number
}

type Product = {
  key: 'Product'
  title: string
  price: number
}
</script>

<template>
  <component :is="GenCo<User | Product>" /> <!--  18:19  error  Filters are deprecated               vue/no-deprecated-filter -->
</template>

What did you expect to happen?
The rule should not trigger

What actually happened?
Triggers vue/no-deprecated-filter.

I suspect because it fails to parse the content of <component :is /> correctly.
Note this issue was not present previously, so it might be a regression

Repository to reproduce this issue
https://github.com/darioackermann/eslint-vue-ts-filter

Metadata

Metadata

Assignees

No one assigned

    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