eslint-plugin-vue icon indicating copy to clipboard operation
eslint-plugin-vue copied to clipboard

No nested html-indent within noscript tag

Open BerniWittmann opened this issue 5 years ago • 2 comments

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 )

BerniWittmann avatar May 05 '20 18:05 BerniWittmann

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">.

ota-meshi avatar May 26 '20 02:05 ota-meshi

Thanks for the hint and the workaround

BerniWittmann avatar May 27 '20 11:05 BerniWittmann