Add a .prettierrc (or .prettierrc.json) to auto-format JSON (and JS) files
Prettier is great. Having a definitions file will ensure that (at least for people who have the extension installed in their editor), the files are all consistently formatted.
Good idea -- if you want to submit a PR we can see how well it might work.
Here's the config I would recommend, but it does incorporate some of my own personal preferences.
{
"arrowParens": "avoid",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"parser": "json",
"printWidth": 80,
"proseWrap": "preserve",
"requirePragma": false,
"semi": true,
"singleQuote": false,
"tabWidth": 4,
"trailingComma": "none",
"useTabs": true
}
Here's an easy way to try the different options and pick the config you like. There's a "copy config json" button at the bottom once you've got settings you're happy with.
Cool - that looks good to me, @shaedrich @KamasamaK what do you think?
I've never used Prettier, but it seems like a good idea to enforce (formatting) standards for the project.
Please see https://github.com/foundeo/cfdocs/pull/1649 for committed rules for .prettierrc and .cflintrc. If people are okay with these rules, I can apply to JSON files.