Base Prettier Config
Use these as a starting point for Prettier configuration on Vegan Hacktivists projects.
React Projects
{
"overrides": [
{
"files": "*.{js,jsx,ts,tsx}",
"options": {
"arrowParens": "always",
"jsxBracketSameLine": false,
"parser": "typescript",
"printWidth": 80,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all"
}
},
{
"files": "*.css",
"options": {
"parser": "css",
"printWidth": 80,
"singleQuote": true,
"tabWidth": 2
}
},
{
"files": "*.json",
"options": {
"parser": "json",
"printWidth": 80,
"tabWidth": 2
}
}
]
}
Other Projects
Note: You'll want to install the Laravel Blade plugin for Prettier.
{
"overrides": [
{
"files": "*.js",
"options": {
"arrowParens": "always",
"jsxBracketSameLine": false,
"parser": "babel",
"printWidth": 80,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all"
}
},
{
"files": "*.css",
"options": {
"parser": "css",
"printWidth": 80,
"singleQuote": true,
"tabWidth": 2
}
},
{
"files": "*.json",
"options": {
"parser": "json",
"printWidth": 80,
"tabWidth": 2
}
},
{
"files": "*.blade.php",
"options": {
"parser": "blade",
"sortTailwindcssClasses": true,
"tabWidth": 2
}
}
]
}