Skip to content

Support Linting of HTML strings in JS template literals. #4874

@mcareydsgn

Description

@mcareydsgn

Product

axe Linter

Question

Is there support for linting HTML strings in JavaScript template literals? I often use Web Components or template literals in vanilla JS and it does not appear have any linting in VS Code.

Example

const inputAndLabel = `
     <label>
             Search
     </label>
     <input type="search"  id="search" />
`;

I would expect this to tell me that the label is missing the for attribute.
I don't expect validation if the label and input were separate variables, however multi-line strings like in the example would be a nice feature if it does not exist.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featNew feature or enhancementlintingAxe-linter issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions