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

Parsing error, if the script tag is placed between frontmatter and html code #414

Open
2 tasks done
fullstackjunior opened this issue Aug 16, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@fullstackjunior
Copy link

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

9.9.0

What version of eslint-plugin-astro are you using?

1.2.3

What did you do?

Configuration
import eslintPluginAstro from 'eslint-plugin-astro';
export default [
  ...eslintPluginAstro.configs.recommended
  {
    rules: {
        "astro/no-unused-css-selector": 1
    }
  }
];
---
---
<script></script>

<!doctype html>

What did you expect to happen?

I expect no errors because the doctype directive is valid.

What actually happened?

Linter shows error:

Parsing error: Unknown token at 233, expected: "<!--", actual: "<!doctype "

Link to Minimal Reproducible Example

https://eslint-online-playground.netlify.app/#eNp9UstO6zAQ/RVfb9iQadPeK10KQiCxZMEeg2TsaXFx7Mh2Cgj13/GrUSoeWdjxnDNnZo7mg3onZrf83Q4BuA/O0hVtmoaZfDBz4YVTfbi8mNWfHPwjrQjvPZLn0OlLekrRa2UCCGvWagNbH1VU11sXSEHu9LBR5joVIGtnO3JS4k2fgSaXPjlnBt9ylsQ1H3Qg98wQAgBfVGopDw6F7To0EuVpIn+kgxA3aPSrwyt9jOYiM2ObwQweZSO8bzxqFME6RlekzQKE7NMVj4fzOFnPxQvfYJzJmjhVFmTU8A5TShTlnNGcyGiypEQ7K2MDI7BD55U1BZvDHNoRKrb6BNVmGZW4q+LZsPysvcWEwF34GX4alJZTuAZGQu9wp/B1ShlDIynHJxRGsye1Z4l9MtwIhceNX2Xy1keTZXXi8T8sYfG99ONfaBcJPBbf3fyoX/ZgVi4nqswSWphPShxo25wdCWdwdkQo+K/g0WZWZgsLWE6YG22fuD4Uaf8Vobo9e7r/BMJsD2U=

Additional comments

If I replace the script tag and put it after html code, the error disappears

@ota-meshi ota-meshi added the bug Something isn't working label Sep 14, 2024
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

2 participants