Skip to content
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

Add Prettier configuration to avoid quote changes on save #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MarcelCutts
Copy link

What's the problem?

Hello! So for folks who use the VSCode Prettier extension, a lot of files will be reformatted on save. By default, this means all single quotes are turned into double quotes, so a simple change suddenly results in an avalanche of updates.

See below for an example of just changing the margin value and stomping {cmd|ctrl}+s in app.css.
Screenshot from 2021-11-09 18-50-26

Whatctha doing doing about it?

You can tell Prettier to embrace the single quote lifestyle in the usual volley of ways. A custom configuration file, a JSON blob somewhere, or adding to package.json. This means saving now will not cause unintended additional formatting changes for Prettier users.

The additional Prettier configuration will not affect non-Prettier users.

OK cool but you have to tell me the drawbacks

While Prettier has been pretty (heh) popular at all the gigs I've taken for the last few years, it is an extra bit of configuration, small, but also now it's something else to maintain as technical overhead. For example, if they change the configuration key from singleQuote to quoteIsSingle (a dumb example but it's late OK) then this will need to be updated again.

No configuration at all is a good way to let users know "hey this is your plugin and thus your problem".

Anyway! Up to you, I just thought I'd provide the option.

austin-powers-quote-on-quote

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant