@aleph-alpha/prettier-config-frontend
Shared Prettier configuration for Aleph Alpha frontend projects.
Install
pnpm add -D @aleph-alpha/prettier-config-frontend prettier
prettier (>=3.3 <4) is a peer dependency. Install it alongside this package.
Usage
Create a .prettierrc.mjs in your project root:
import config from '@aleph-alpha/prettier-config-frontend';
export default config;
To override individual options, spread and replace:
import config from '@aleph-alpha/prettier-config-frontend';
export default {
...config,
printWidth: 80,
};
What this config sets
| Option | Value | What it does |
|---|---|---|
arrowParens | 'always' | Always wrap arrow function parameters in parentheses, even single ones |
bracketSameLine | false | Multi-line HTML/JSX closing brackets go on their own line |
bracketSpacing | true | Spaces inside object braces: { foo: bar } not {foo: bar} |
endOfLine | 'lf' | Unix-style line endings; protects against Windows CRLF drift |
htmlWhitespaceSensitivity | 'css' | Respect each tag's CSS display property when collapsing whitespace |
printWidth | 80 | Wrap lines at 80 characters |
proseWrap | 'preserve' | Don't reflow Markdown prose lines |
quoteProps | 'as-needed' | Quote object keys only when required |
semi | true | Always end statements with semicolons |
singleQuote | true | Use single quotes for strings |
tabWidth | 2 | 2 spaces per indentation level |
trailingComma | 'all' | Trailing commas everywhere multi-line allows |
useTabs | false | Use spaces, not tabs |
vueIndentScriptAndStyle | false | Don't indent content of <script> and <style> blocks in Vue SFCs |
All options are stated explicitly so the config is self-documenting; defaults are not assumed.
Versioning
This package follows semver. Breaking changes (renamed options, removed plugins) bump major; new options or plugins bump minor; everything else patch.