-
-
Notifications
You must be signed in to change notification settings - Fork 679
vue/require-default-prop triggers for optional props (TypeScript) #2306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Duplicate of #2051. Thanks for the detailed issue description though 🙂 |
Is it a duplicate? I've seen that issue, but I thought it was concerned with props consisting of defineProps({ name: { type: String, default: undefined } }) versus this issue targeting the type parameters, i.e. defineProps<{ name?: string }>() |
Hmm, it's not an exact duplicate, but definitely the same root issue. See also the |
Sure, will do. Thanks! |
Uh oh!
There was an error while loading. Please reload this page.
Checklist
Tell us about your environment
Additionally:
@typescript-eslint/eslint-plugin
, v6.9.0typescript
, v5.2.2Please show your full configuration:
eslint:recommended
+plugin:vue/vue3-recommended
+plugin:@typescript-eslint/recommended
.Contents of
.eslintrc.js
What did you do?
What did you expect to happen?
undefined
ought to be a perfectly reasonable default value for theheight
prop, thevue/require-default-prop
rule should not alert me to set a default.For reference, this doesn't trigger
vue/require-default-prop
at all:What actually happened?
Repository to reproduce this issue
https://github.com/dmke/vue-require-default-prop-repro
The text was updated successfully, but these errors were encountered: