Skip to content
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

Require default export on <script> #2383

Open
privatenumber opened this issue Jan 29, 2024 · 1 comment
Open

Require default export on <script> #2383

privatenumber opened this issue Jan 29, 2024 · 1 comment

Comments

@privatenumber
Copy link
Contributor

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

@ota-meshi
Copy link
Member

Thank you for the rule suggestion! Sounds good to me.

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