We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
9.9.0
eslint-plugin-astro
1.2.3
import eslintPluginAstro from 'eslint-plugin-astro'; export default [ ...eslintPluginAstro.configs.recommended { rules: { "astro/no-unused-css-selector": 1 } } ];
--- --- <script></script> <!doctype html>
I expect no errors because the doctype directive is valid.
Linter shows error:
Parsing error: Unknown token at 233, expected: "<!--", actual: "<!doctype "
https://eslint-online-playground.netlify.app/#eNp9UstO6zAQ/RVfb9iQadPeK10KQiCxZMEeg2TsaXFx7Mh2Cgj13/GrUSoeWdjxnDNnZo7mg3onZrf83Q4BuA/O0hVtmoaZfDBz4YVTfbi8mNWfHPwjrQjvPZLn0OlLekrRa2UCCGvWagNbH1VU11sXSEHu9LBR5joVIGtnO3JS4k2fgSaXPjlnBt9ylsQ1H3Qg98wQAgBfVGopDw6F7To0EuVpIn+kgxA3aPSrwyt9jOYiM2ObwQweZSO8bzxqFME6RlekzQKE7NMVj4fzOFnPxQvfYJzJmjhVFmTU8A5TShTlnNGcyGiypEQ7K2MDI7BD55U1BZvDHNoRKrb6BNVmGZW4q+LZsPysvcWEwF34GX4alJZTuAZGQu9wp/B1ShlDIynHJxRGsye1Z4l9MtwIhceNX2Xy1keTZXXi8T8sYfG99ONfaBcJPBbf3fyoX/ZgVi4nqswSWphPShxo25wdCWdwdkQo+K/g0WZWZgsLWE6YG22fuD4Uaf8Vobo9e7r/BMJsD2U=
If I replace the script tag and put it after html code, the error disappears
The text was updated successfully, but these errors were encountered:
According to the html specifications html files need to start with <!doctype html>.
<!doctype html>
So what you are doing is invalid html, the correct html would be:
--- --- <!doctype html> <html> <script></script> </html>
And the error is telling you that this is also valid:
<!-- Any html comment here --> <!doctype html> ...the rest of your html
So to help you further a question would be, why do you want to load a script before the declaration of the html?
Sorry, something went wrong.
No branches or pull requests
Before You File a Bug Report Please Confirm You Have Done The Following...
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
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
The text was updated successfully, but these errors were encountered: