Skip to content

Require default export on <script> #2383

Closed
@privatenumber

Description

@privatenumber

Please describe what the rule should do:

To warn when there's a <script> tag with no default export.

With the new <script setup> syntax, I've noticed cases where devs forget or miss the setup and can't figure why their code is not working correctly.

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:

<!-- Forgetting to add `setup` -->
<script>
const value = 1;
</script>

Additional context

From: #2328

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions