Skip to content

Extend invalid escape sequences rule to other tagged template literals #179

@mikejamesthompson

Description

@mikejamesthompson

Template literals used as values for the css and svg tag functions are vulnerable to the same issues with invalid escape sequences as the html tag function.

For example the following code leads to an empty CSS result with no error or warning to indicate what's gone wrong:

const styles = css`
  p::before {
    content: "\2716";
  }
`;

I'd be in favour of expanding the no-invalid-escape-sequences rule to cover these other kinds of template literals.

Happy to do a PR for this with docs changes if that's helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions