Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emojis break parsing of templates #377

Closed
Cherry opened this issue Jan 17, 2025 · 0 comments · Fixed by #379
Closed

Emojis break parsing of templates #377

Cherry opened this issue Jan 17, 2025 · 0 comments · Fixed by #379

Comments

@Cherry
Copy link

Cherry commented Jan 17, 2025

Playground link: https://eslint-online-playground.netlify.app/#eNqNUUFO6zAQvcp8S5U+pUlYh7QrFuzYIDakC+NMG4NjW7ZTiqpcggtwBY7GERjbILVISCSKHL2Zee/N84F5Jyrc88EqLPswKFazZgbVHLbKPHAFo0fnYV7BbNXqxq6uUSnzDz7eXt+byhJG6Aw2xsF/2HEHEpZwcUlHk0dLhXobekLOz+EMDokHoFFy1XDoHW6WLSkuc/e9XJejU7GJrU5QzQckuKk4fTScZKfExhasRK+kDk6Uj542GEw30j64t8YFT44O5DPgPqDufA33Lcv9tUNhhoFQ7Fq2gJZZNW6lrpXpuO+LgJQLD1gd9RXPMvRFjKpl60XktdyRyxsbpNHEnrRITQz8jswTWBNxpPGBRHLVm9EJvH2xGIvZb8tibUodZofOyQ6T2zTxRduGjVQZZvMSH/23i/haZwR6b1xS/LFDtpxbs8gvpKecx6n9NR0vnLS07PpLLR70P9FNWS6e+BZJxGi6KTIA5LXD3RXayKCFRNJPMQI931cVoZMUj4tFNlb8MHY6E0fIycSmT0lACHY=

With a template like this:

<% /* global users */ %>
<p>Hello!</p>

<% for ( var i = 0; i < users.length; i++ ) { %>
  <li><a href="<%= users[i].url %>"><%= users[i].name %></a></li>
<% } %>

No errors are reported. However, if you include an emoji like this:

<% /* global users */ %>
<p>Hello! 💰</p>

<% for ( var i = 0; i < users.length; i++ ) { %>
  <li><a href="<%= users[i].url %>"><%= users[i].name %></a></li>
<% } %>

Errors are reported such as:

Unnecessary semicolon.
lodash-template/no-semi-in-template-interpolation [5:33-34]

and an autofix results in mangled output:

<% /* global users */ %>
<p>Hello! 💰</p>

<% for ( var i = 0; i < users.length; i++ ) { %>
  <li><a href="<%= users[i].%>"><%= users[i].n%></a></li>
<% } %>

(note the users[i]. in the li.a)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant