-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
Force TypeScript only defineProps #1959
Comments
Thank you for the rule suggestions! That rule sounds good to me. I would prefer to name the rule |
@ota-meshi yeah, this sounds good to me! I've read through some other threads and saw that you're not too experienced with the TS AST tree. I'd be willing to put down a one time sponsorship for this specific issue if you want to challange this one. : ) |
I'm not familiar with TS AST (and TS syntax). If someone opens a PR, we'll merge it, but if there's a bug in the added rule, it's possible that I can't fix it. I need help from the community. |
I would love to implement this rule. Here are some thoughts, please help to review. Basic process flow
Questions
Lower priority features (maybe in a separate PR next time)
|
This sounds great! As for combining it with emit or not, I don't mind either way. Personally I will always use both of them but I'm not sure if some ppl wanna split them up. Split into two rules might make the documentation a bit easier to digest as well. |
Thank you for your contribution. |
Please describe what the rule should do:
Forces the TypeScript only way of defining props.
What category should the rule belong to?
[x] Enforces code style (layout)
[ ] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
GOOD
const props = defineProps<{ /** * The kind of button to render */ kind: 'primary' | 'secondary', }>()
BAD
const props = defineProps({ /** * The kind of button to render */ kind: { type: String as PropType<'primary' | 'secondary'> }, })
BAD
The text was updated successfully, but these errors were encountered: