Skip to content

⭐️New: Add vue/valid-slot-scope rule #670

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
wants to merge 7 commits into from

Conversation

ota-meshi
Copy link
Member

This PR add vue/valid-slot-scope rule. (#661)

vue/valid-slot-scope rule checks whether every slot-scope (or scope) attributes is valid.

Close #661

@armano2
Copy link
Contributor

armano2 commented Nov 20, 2018

@mysticatea as far as I know scoped slots allow only one parameter, and documentation is not giving any examples for more than one

@ota-meshi ota-meshi self-assigned this Nov 22, 2018
mysticatea added a commit to vuejs/vue-eslint-parser that referenced this pull request Nov 24, 2018
@ota-meshi
Copy link
Member Author

@mysticatea Thank you for released a new version of vue-eslint-parser.
I updated this rule.
This rule now only check for empty values.

Copy link
Member

@mysticatea mysticatea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@ota-meshi ota-meshi force-pushed the add-rule/valid-slot-scope branch from df5359a to 85ee7d9 Compare December 4, 2018 04:46
@tangjinzhou
Copy link

Why not support multiple parameters? Our component uses multiple parameters.
And, I think empty value also should not be reported incorrectly.
ref vueComponent/ant-design-vue#301

@ota-meshi
Copy link
Member Author

@tangjinzhou

Why not support multiple parameters? Our component uses multiple parameters.

Could you write details and post the issue.

And, I think empty value also should not be reported incorrectly.

What is the reason for this?
I think that blank should be reported, because it makes no sense.

@tangjinzhou
Copy link

@ota-meshi

I think that blank should be reported, because it makes no sense.

The slot-scope is like a function. For example ()=> <span/>.
I expect to get a slot that can be reused. Its role is to provide a component with a reusable slot.
So should not be limited by the number of parameters.

@tangjinzhou
Copy link

@ota-meshi
Maybe it is the best practice.
But should not be so strictly prohibited.
It is best to provide a separate rule instead of no-parsing-error.

@tangjinzhou
Copy link

#722

@ota-meshi
Copy link
Member Author

#722 (comment)

@ota-meshi ota-meshi closed this Dec 18, 2018
@ota-meshi ota-meshi deleted the add-rule/valid-slot-scope branch May 19, 2020 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants