Add Prettier configuration to avoid quote changes on save #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
.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
toquoteIsSingle
(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.