@nesvel/prettier-config
v1.0.3
Published
Shared Prettier configuration for the Nesvel monorepo
Maintainers
Readme
@nesvel/prettier-config
Shared Prettier configuration for the Nesvel monorepo.
Usage
Option 1: JSON (Recommended - Universal)
In your package's package.json:
{
"prettier": "@nesvel/prettier-config"
}Or in .prettierrc.json:
"@nesvel/prettier-config"Option 2: TypeScript (Experimental)
Requirements: Node.js >= 22.6.0
Create prettier.config.ts:
import config from '@nesvel/prettier-config/ts';
export default config;Run Prettier with experimental flag:
# Node.js >= 22.6.0 < 24.3.0
NODE_OPTIONS="--experimental-strip-types" prettier . --write
# Node.js >= 24.3.0
prettier . --writeConfiguration Details
- Semi: Always use semicolons
- Single Quote: Use single quotes for strings
- Trailing Comma: ES5-compatible trailing commas (objects, arrays)
- Print Width: 100 characters (80 for JSON and Markdown)
- Tab Width: 2 spaces
- Arrow Parens: Always include parentheses around arrow function parameters
- End of Line: LF (Unix-style)
- HTML Whitespace Sensitivity: CSS-aware
- Embedded Language Formatting: Auto-format embedded languages
Overrides
- JSON files: Print width of 80 characters, no trailing commas
- Markdown files: Print width of 80 characters, always wrap prose for better git diffs
- YAML files: Tab width of 2, use double quotes
