📋JSON Templates
.prettierrc.json Configuration
Prettier code formatter configuration.
Explanation
Prettier config defines code formatting preferences for consistent style.
Examples
Standard Config
Output
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"arrowParens": "always",
"endOfLine": "lf"
}Code Examples
.prettierrc.json
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"arrowParens": "always",
"endOfLine": "lf",
"bracketSpacing": true,
"bracketSameLine": false
}Try it Now
💡 Tips
- Keep config minimal - use defaults when possible
- Match team preferences
- Use .prettierignore for excluded files
- Integrate with editor for format on save
- Run prettier in CI/CD
⚠️ Common Pitfalls
- Don't override too many defaults
- Coordinate with ESLint config
- Windows: set endOfLine to "auto" or "lf"