Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Enhancement: Support EJS files #77

@LightCC

Description

@LightCC

It appears that EJS (Embedded JavaScript) files could be supported pretty easily on this extension.

EJS templates embedded javascript with <% begin tags and %> end tags, with javascript and other characters that drive various behavior inbetween the ejs start/stop tags.

Currently, htmlhint gives the following error on these tags:
image

image

So, one can work around this by turning off the spec-char-escape rule, but then the rule won't catch any non-ejs issues with special character escaping.

The following should be considered for ejs files (*.ejs) by default, or allow explicit configuration by user somehow. These are considered as least support for ejs to most support (but also least amount of work to most amount of work):

  1. Just disable spec-char-escape by default on ejs files (*.ejs)
  2. Ignore the spec-char-escape rule only on <% and %>
  3. Find paired <% and %> tags and ignore both the tags and everything between them
  4. Same as above, but actually lint the ejs tags (<%, <%=, etc.)
  5. Same as above, but also lint the javascript within the ejs tags, or pass off to another linter (e.g. eslint, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions