Skip to content

defineSlots 如果没写 () 不报错 #2295

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
WangJincheng4869 opened this issue Oct 12, 2023 · 4 comments
Closed

defineSlots 如果没写 () 不报错 #2295

WangJincheng4869 opened this issue Oct 12, 2023 · 4 comments

Comments

@WangJincheng4869
Copy link

Please describe what the rule should do:

defineSlots 语法错误

What category should the rule belong to?

[ ] Enforces code style (layout)
[x] 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:

Additional context

image
正确写法:

defineSlots<{
  header(): any;
  main(): any;
}>();

错误写法:

defineSlots<{
  header(): any;
  main(): any;
}>;
@FloEdelmann
Copy link
Member

Please write your issues in English, it's difficult to understand this suggestion. If I understood correctly, you are suggesting a new rule that warns about defineSlots if the parentheses () are missing.

@ota-meshi Do you think this rule is a good idea? Shouldn't the Vue compiler warn about this already?

@FloEdelmann
Copy link
Member

Maybe it's also implicitly implemented by #2294, since defineSlots without () would not silence the warning about a used slot.

@WangJincheng4869
Copy link
Author

Please write your issues in English, it's difficult to understand this suggestion. If I understood correctly, you are suggesting a new rule that warns about defineSlots if the parentheses () are missing.

@ota-meshi Do you think this rule is a good idea? Shouldn't the Vue compiler warn about this already?

是的!您理解的是对的!(Yes! What you understand is correct!)

@ota-meshi
Copy link
Member

I don't understand what you are requesting in this issue. So I'll close this issue.
Please write the issue in English and enter all necessary information.

@ota-meshi ota-meshi closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2023
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

3 participants