Created by: dmfrancisco
Using Prettier in the code editor is very useful and it's even incentivized in the last sentence of the "Formatting Code Automatically" section of the User Guide. Users can also have a custom Prettier configuration in their package.json
, which is automatically used by code editor extensions and the Prettier CLI.
However, the instructions in this section pass a --single-quote
option to the CLI which will override the user's custom config (if existent). This means the code automatically formatted by their editors may be different to what will end up being committed.
Ideally, it would be great if we could simplify and remove the custom --single-quote
config, but I guess this was added to match the styling of the generated files (such as serviceWorker.js
).
In this PR I moved the configuration to the "prettier"
key in the package.json
so that is used by both the CLI and code editor extensions.
I also added a sentence explaining what the key is about so it's harder to miss (because some users may be using a prettier.config.js
or .prettierrc
file instead and will want to adjust).
Feel free to close if you disagree! Thank you for creating this project and documenting it so well
The reason for this is that I use Prettier in VS Code and have recently blindly copied these instructions, and got confused when I started seeing single quotes instead of double quotes in my committed files, despite having my custom config.