Loading…
Generate custom Prettier configuration for consistent code formatting. Review the result before reusing it in another workflow.
Use Tabs
Use tabs instead of spaces
Semicolons
Print semicolons at the end of statements
Single Quotes
Use single quotes instead of double quotes
JSX Single Quotes
Use single quotes in JSX
Bracket Spacing
Spaces between brackets in objects
Bracket Same Line
Put > of JSX tag on same line
Single Attribute Per Line
Enforce single attribute per line in HTML/JSX
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"jsxSingleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always",
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf",
"quoteProps": "as-needed",
"singleAttributePerLine": false
}// Sample JavaScript code
const fetchUserData = async (userId) => {
const response = await fetch(`/api/users/${userId}`);
const data = await response.json();
return { id: data.id, name: data.name, email: data.email };
};
function Button({ label, onClick, disabled }) {
return (
<AppButton className="btn btn-primary" onClick={onClick} disabled={disabled}>
{label}
</AppButton>
);
}
export { fetchUserData, Button };Current Settings:
Line Settings: