haml-lint icon indicating copy to clipboard operation
haml-lint copied to clipboard

False positive on the `UnnecessaryStringOutput` cop

Open ydakuka opened this issue 11 months ago • 1 comments

Describe

I have the haml code:

= "#{user.payment_price_btc}\u202F\u0243"

On the browser page:

0.01000000 Ƀ

I run haml-lint and I get:

ydakuka@yauhenid:~/Work/project$ haml-lint ./app/views/users/
app/views/users/_list.html.haml:59 [W] UnnecessaryStringOutput: `= "..."` should be rewritten as `...`

45 files inspected, 1 lint detected

However, if I follow the recommendation, I'll get the following haml code:

#{user.payment_price_btc}\u202F\u0243

And this, on the browser page:

0.01000000\u202F\u0243

ydakuka avatar Mar 20 '24 10:03 ydakuka

Not sure if it's the same bug but

= "#{t('some.key')}: "

is marked as well (notice the colon at the end).

mingan avatar Aug 16 '24 11:08 mingan