-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
vue/require-default-prop
should not trigger when type is x | undefined
without default value
#2475
Comments
vue/require-default-prop
should not trigger when type is x | undefined
without default value
I'm not sure if I agree; every optional property (with a |
Hmm yea I get that, is it typescript doing the automatic undefined? can we somehow disable that and then apply the rule? |
Yes it is. I don't think we can turn that off. |
https://www.typescriptlang.org/tsconfig/#exactOptionalPropertyTypes I'm using it in my projects to force an explicit Not sure if it helps with this exact situation, but there is support in TS for it. One of our dependencies requires it: https://github.com/Effect-TS/effect/tree/main/packages/schema#requirements. |
What rule do you want to change?
vue/require-default-prop
Does this change cause the rule to produce more or fewer warnings?
Is will provide less warnings if the type is already defined as undefined.
How will the change be implemented? (New option, new default behavior, etc.)?
Could be an option to not throw the error / warning when props is not required and has a undefined type set
Please provide some example code that this change will affect:
What does the rule currently do for this code?
Throws a warning at the propertyName prop
What will the rule do after it's changed?
Will not complain about the propertyName prop
Additional context
If needed, I can look into it myself but I will need to be pointed to the correct files :)
The text was updated successfully, but these errors were encountered: