ember-angle-brackets-codemod
ember-angle-brackets-codemod copied to clipboard
Rewrites escaped quotes to quotes (causing Template Compiler Error)
{{foo-bar "placeholder="Choose a \"thing\"..."}}
was rewritten to
<FooBar @placeholder="Choose a "thing"" />
@kategengler nice one! I’ll try to look at it in 2019 😆. Seriously I’ll try to at least get my head wrapped around this in the next day or so.
with input fixture like this the test fails
let input = `
{{foo-bar placeholder="Choose a \"thing\" here"}}
`;
But if the input fixture has double slashes like this, the test passes.
let input = `
{{foo-bar placeholder="Choose a \\"thing\\" here"}}
`;
@kategengler Out of curiosity, it is recommended not to use bare strings in templates right? Aren't you folks using any template-lint rules with bare-strings rule enabled.
@rajasegar no-bare-strings is not enabled by default in ember-template-lint, neither in recommended nor octane rulesets. It's an optional rule that can be enabled in apps that enforce internationalization. This doesn't apply to all apps -- I often build internal apps that are used by just a few people and so bare strings in the default language are fine.
@kategengler Makes sense, understood.
@kategengler @rajasegar there is a fix pending. It might be in the new ember-template-recast, as the root problem existed in the glimmer printer. This should be close to being finished.
@tylerturdenpants So the fix would be to just bump ember-template-recast to a new version , I assume
@rajasegar yes. I reopen a dependabot closed PR that would have down that but it looks like maybe another issue made its way through.