Skip to content

Support for type-based prop declarations and default values #1947

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

Closed
wolfsblu opened this issue Aug 16, 2022 · 1 comment
Closed

Support for type-based prop declarations and default values #1947

wolfsblu opened this issue Aug 16, 2022 · 1 comment

Comments

@wolfsblu
Copy link

What rule do you want to change?
vue/no-setup-props-destructure

Does this change cause the rule to produce more or fewer warnings?
Change will produce fewer warnings

How will the change be implemented? (New option, new default behavior, etc.)?
New default behavior

Please provide some example code that this change will affect:

const {
    myProp = null
} = defineProps<{
    myProp: number | null
}>()

What does the rule currently do for this code?
It throws an error for default values in type-based prop declarations.

What will the rule do after it's changed?
It will support the default value syntax for type-based prop declarations [1].

Additional context
[1] https://vuejs.org/guide/typescript/composition-api.html#props-default-values

@ota-meshi
Copy link
Member

Reactivity Transform is still an experimental feature, so eslint-plugin-vue does not support it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants