StackBlitz uses Prettier 2.x by default on most common frontend code, defaulting to format files on save.
When users fork a starter template such as the react-ts template and then edit a file and save, that file may get reformatted by Prettier with different settings than what was used to produce that starter template. This can look a bit glitchy, because the end user only changed a few characters but potentially many more characters are going to be modified by Prettier.
To avoid this issue, the starter templates in this repository should be formatted using Prettier, with default settings that are identical to the default settings used on stackblitz.com.
As far as I can tell, stackblitz.com:
uses Prettier 2.4 in its editor;
uses Prettier's default settings, with the exception of "singleQuote": true.
In this PR I'm adding:
A .prettierrc config suitable to mimic what stackblitz.com uses by default;
Prettier as a dev dependency;
A GitHub action checking PRs for correct formatting.
So far I have not reformatted all templates. As a proof of concept, I only reformatted the EngineBlock templates, and have added all other templates to .prettierignore. We could reformat all templates in this PR, or in a subsequent PR.
StackBlitz uses Prettier 2.x by default on most common frontend code, defaulting to format files on save.
When users fork a starter template such as the
react-ts
template and then edit a file and save, that file may get reformatted by Prettier with different settings than what was used to produce that starter template. This can look a bit glitchy, because the end user only changed a few characters but potentially many more characters are going to be modified by Prettier.To avoid this issue, the starter templates in this repository should be formatted using Prettier, with default settings that are identical to the default settings used on stackblitz.com.
As far as I can tell, stackblitz.com:
"singleQuote": true
.In this PR I'm adding:
.prettierrc
config suitable to mimic what stackblitz.com uses by default;So far I have not reformatted all templates. As a proof of concept, I only reformatted the EngineBlock templates, and have added all other templates to
.prettierignore
. We could reformat all templates in this PR, or in a subsequent PR.