Skip to content

Rule Proposal: valid-slot-scope #661

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
1 of 4 tasks
ota-meshi opened this issue Nov 13, 2018 · 0 comments
Closed
1 of 4 tasks

Rule Proposal: valid-slot-scope #661

ota-meshi opened this issue Nov 13, 2018 · 0 comments

Comments

@ota-meshi
Copy link
Member

Please describe what the rule should do:

This rule checks whether every slot-scope (or scope) attributes is valid.
This rule reports the following cases:

  • The slot-scope attribute does not have that attribute value. E.g. <div slot-scope></div>
  • The slot-scope attribute have the attribute value which is extra access to slot data. E.g. <div slot-scope="prop, extra"></div>
  • The slot-scope attribute have the attribute value which is rest parameter. E.g. <div slot-scope="...props"></div>

maybe "extra access" and "rest parameter" are mistakes of destructuring.

What category should the rule belong to?

  • Enforces code style
  • Warns about a potential error
  • Suggests an alternate way of doing something
  • Other (please specify:)

Provide 2-3 code examples that this rule should warn about:

<template>
  <TheComponent>
    <template slot-scope>
      ...
    </template>
  </TheComponent>
  <TheComponent>
    <template slot-scope="">
      ...
    </template>
  </TheComponent>
  <TheComponent>
    <template slot-scope="...props">
      ...
    </template>
  </TheComponent>
  <TheComponent>
    <template slot-scope="a, b, c">
      <!-- `b` and `c` are extra access. -->
      ...
    </template>
  </TheComponent>
</template>

Additional context

slot-scope

@ota-meshi ota-meshi self-assigned this Nov 22, 2018
@ota-meshi ota-meshi changed the title Rule Proposal: valid-valid-slot-scope Rule Proposal: valid-slot-scope Nov 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants