-
-
Notifications
You must be signed in to change notification settings - Fork 694
Open
Labels
@VividLemon
Description
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.45.0
- eslint-plugin-vue version: 9.15.1
- Node version: v20.3.1
- Operating System: Linux
Please show your full configuration:
/* eslint-env node */ require('@rushstack/eslint-patch/modern-module-resolution') const {defineConfig} = require('eslint-define-config') module.exports = defineConfig({ root: true, 'extends': [ 'plugin:vue/vue3-essential', 'eslint:recommended', '@vue/eslint-config-typescript', '@vue/eslint-config-prettier/skip-formatting' ], parserOptions: { ecmaVersion: 'latest' }, rules: { 'vue/require-valid-default-prop': 'error' } })
What did you do?
<script setup lang="ts"> import type { Foo } from '../types'; // type Foo = boolean const props = withDefaults(defineProps<{ msg?: Foo | 'foo' }>(), { msg: false, // Errors here `Type of the default value for 'msg' prop must be a string.` }) </script> <template> <div class="greetings"> </div> </template>
export type Foo = boolean
What did you expect to happen?
No error, this is valid syntax post Vue 3.3
What actually happened?
Type of the default value for 'msg' prop must be a string.
This is incorrect, as this is correct post Vue 3.3.
Repository to reproduce this issue
https://github.com/VividLemon/vue-eslint-require-default-prop-bug