-
Notifications
You must be signed in to change notification settings - Fork 32
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
running codemod on rendering tests breaks on < character #240
Comments
👍 |
I'm not sure where the best place to fix this is, but I recreated in ember-template-lint/ember-template-recast#208. |
This codemod should not be running on JavaScript files at all... |
@rwjblue fwiw, it would be really nice to be able to run these on rendering tests instead of needing to migrate those manually to angle-brackets syntax. The codemod actually works almost unexpectedly well in JS files containing templates, but with a few snags |
If we do want to support running on JS (which seems like a win for rendering tests), we probably need to just make this very slightly smarter and have it check on the context to guarantee that the string being parsed is one that's being passed as an arg to the |
I've been running the codemod on all of my project's rendering tests, ala anything that has
We've actually had pretty good success for the most part, but I have noticed a fun / interesting bug: If you test JS file contains the character
<
inside a string, or inside a comment block, the codemod seemingly attempts to parse this as HTML & blows up. A few examples we had were things like:Our workaround has been to just delete the characters
<
and>
from any string / comment, run codemod, then add the characters back. Would be great is the codemod could be configured to only run on the actualhbs
blocks inside the test instead of the entire file.The text was updated successfully, but these errors were encountered: