eslint-plugin-vue
eslint-plugin-vue copied to clipboard
No nested html-indent within noscript tag
Tell us about your environment
- ESLint version: 5.16.0
- eslint-plugin-vue version: 5.2.3
Please show your full configuration:
{
"root": true,
"env": {
"browser": true,
"node": true
},
"parserOptions": {
"parser": "babel-eslint"
},
"extends": [
"@nuxtjs",
"@nuxtjs/eslint-config-typescript",
"plugin:nuxt/recommended"
],
"rules": {
}
}
What did you do?
I'm having the following problem with the html-indent rule. Inside a noscript tag, the rule expects the nested elements not to be indentend. It seems to be related to the wrapped noscript tag. I'm not sure whether this is a bug or intended behaviour. If this should be an intended behavior i would be glad about some pointers on how to disable this.
You can also reproduce and fiddle around here: mysticatea-demo-playground
<template>
<div>
<!-- ✓ vue/html-indent fine -->
<noscript>
<ul>
<li>
<p>Test</p>
</li>
</ul>
</noscript>
<!-- ✗ vue/html-indent Error -->
<noscript>
<ul>
<li>
<p>Test</p>
</li>
</ul>
</noscript>
<!-- ✓ vue/html-indent fine -->
<div>
<ul>
<li>
<p>Test</p>
</li>
</ul>
</div>
</div>
</template>
What did you expect to happen?
I expect the noscript tag children to be indented, like the div tag above
What actually happened?
Expected indentation of 6 spaces but found 8 spaces. ( vue/html-indent )
Thank you for this issue.
It looks like a bug, but Vue core seems to be discussing whether to support <noscript>.
https://github.com/vuejs/vue/issues?q=is%3Aissue+noscript+is%3Aopen
I think vue-eslint-parser will skip <noscript> parsing correctly until Vue core policy is decided.
You may be able to work around this issue using <component is="noscript">.
Thanks for the hint and the workaround