vue/no-undef-components : ignore patterns includes children
Closed this issue · 1 comments
Ericlm commented
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: latest
- eslint-plugin-vue version: latest
- Vue version: latest
- Node version: latest
- Operating System: macOS 15.7 (24G222)
Please show your full configuration:
import { globalIgnores } from 'eslint/config'
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
import pluginVue from 'eslint-plugin-vue'
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
// import { configureVueProject } from '@vue/eslint-config-typescript'
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
export default defineConfigWithVueTs(
{
name: 'app/files-to-lint',
files: ['**/*.{ts,mts,tsx,vue}'],
},
globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
pluginVue.configs['flat/essential'],
{
rules: {
"vue/no-undef-components": ["error", {
"ignorePatterns": ['Stuff']
}]
},
},
vueTsConfigs.recommended,
)What did you do?
When having an app with global components using a name like "Switch", all components starting with "Switch" are ignored (event if they don't exist at all). So things like SwitchSomething or SwitchStuff will be considered okay.
// In App.vue
<script setup lang="ts">
</script>
<template>
<Stuff></Stuff>
<!-- Ignored but shouldn't -->
<StuffHello></StuffHello>
</template>
<style scoped></style>What did you expect to happen?
StuffHello should be reported, because I only ignored Stuff, not StuffHello.
What actually happened?
StuffHello is ignored, as well as Stuff and any other component starting with the name Stuff.
Repository to reproduce this issue
https://github.com/Ericlm/eslint-no-undef-comp
Ericlm commented
This is due to the patterns not working on the range (^pattern$) but working on pattern.