Skip to content

Parse the two hyphens in the HTML comment as one hyphen #72

Closed
@ota-meshi

Description

@ota-meshi

I would like to be able to accept directive comment descriptions in eslint-plugin-vue.
However, the comment value did not produce the expected result.

The following HTML comment is parsed as follows:

<template>
  <!-- eslint-disable -- description -->
</template>
[
  {
    "type": "HTMLComment",
    "range": [ /* ...  */ ],
    "loc": { /* ...  */ },
    "value": " eslint-disable - description "
  }
]

I expect the following results.

[
  {
    "type": "HTMLComment",
    "range": [ /* ...  */ ],
    "loc": { /* ...  */ },
-    "value": " eslint-disable - description "
+    "value": " eslint-disable -- description "
  }
]

I've heard that the old HTML specification should avoid consecutive hyphens.
Do you think you should avoid separating the description with two hyphens?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions