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

Lint error from HTML comments in svelte:head script/style #362

Closed
probablykasper opened this issue Apr 21, 2023 · 2 comments
Closed

Lint error from HTML comments in svelte:head script/style #362

probablykasper opened this issue Apr 21, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@probablykasper
Copy link

In v2.10.0 there's a lint error for this:

<svelte:head>
	<!-- Comment -->
	<script></script>
</svelte:head>

Every time you run npm run format, it duplicates the comment (but the lint error never disappears)

Reproduction:

  1. npm create svelte@latest
  2. Add the above code to src/routes/+page.svelte
  3. npm run lint
@joshdales
Copy link

joshdales commented Jun 14, 2023

We just encountered this as well. It only seems to happen when you you a comment that is followed by a script or style tag that is nested in an element.

eg.

<head>
    <!-- comment 1 -->
    <script></script>
    <!-- comment 2 -->
    <style></style>
</head>

becomes

<head>
    <!-- comment 1 -->
    <!-- comment 1 -->
    <script></script>
    <!-- comment 2 -->
    <!-- comment 2 -->
    <style></style>
</head>

@dummdidumm I think that the issue might have come from your PR: #357?

@dummdidumm dummdidumm added the bug Something isn't working label Jun 15, 2023
@probablykasper
Copy link
Author

Seems to be fixed in v3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants