ony3000 / prettier-plugin-classnames

A Prettier plugin that wraps verbose class name based on the `printWidth` option.
MIT License
114 stars 0 forks source link

How can I use quote marks (') instead of speech marks (") #54

Closed tuffstuff9 closed 7 months ago

tuffstuff9 commented 7 months ago

instead of className="bg-blue-500", I would like to have className='bg-blue-500'. Adding this plugin changes the normal settings. How can I fix this? Thank you.

ony3000 commented 7 months ago

This plugin performs Prettier's formatting before processing line wrapping.

Changing single quotes to double quotes is the default behavior of Prettier, regardless of whether you use this plugin or not, and unfortunately this default behavior cannot be fixed by changing the options.

tuffstuff9 commented 7 months ago

Thanks for your response. If the plugin performs prettier's formatting before processing, shouldn't it maintain my original settings? I have "singleQuote": true, in my .prettierrc. Or do you mean that the plugin has its own prettier config which can't be changed?

ony3000 commented 7 months ago

You can check this in the Prettier playground, but even if the singleQuote option is enabled, the delimiter surrounding the class name is changed to double quotes.

feitozabruno commented 7 months ago

You can check this in the Prettier playground, but even if the singleQuote option is enabled, the delimiter surrounding the class name is changed to double quotes.

I'm experiencing the same problem, in the prettier playground it uses single quotes when the --jsx-single-quote option is enabled

ony3000 commented 7 months ago

@feitozabruno Thank you for pointing out what I missed. I forgot about the jsxSingleQuote option because I don't usually use it.

ony3000 commented 7 months ago

@tuffstuff9 @feitozabruno Fixed in v0.6.6, check it out!

tuffstuff9 commented 7 months ago

@tuffstuff9 @feitozabruno Fixed in v0.6.6, check it out!

Works perfectly - your prompt attention is much appreciated!