ember-template-lint/ember-template-recast

Define quotes when generating AttrNode (and probably others)

jjaffeux opened this issue · 2 comments

Hi,

i'm writing a rule fixer for ember-template-lint and I can't find a way to force the type of quotes used when generating my attribute:

builder.attr('foo', builder.text('bar'));

Will generate something like:

foo="bar"

How could I specify it should generate:

foo='bar'

Reading the code it doesn't seem like it's currently supported, am I wrong? Thanks.

You are correct, there is no way to use the builder to produce the correct quoting. Though you could use something akin to what I did in #254.

Bumped into this while trying to do something similar. In my case I completely rebuilt class attribute by overwriting the respective .attribute[x] with output from builder.attr(...).

I wanted to make sure that the quotes are the same that were used before.

Is this just a missing feature or something that is not supported by principle?