@bitforgehq/prettier-config
v1.0.1
Published
Shared Prettier configuration for Angular projects
Downloads
326
Readme
@bitforgehq/prettier-config
Shared Prettier configuration for Angular projects.
Installation
bun add -D @bitforgehq/prettier-configPeer Dependencies
This package requires Prettier:
bun add -D prettier@^3.0.0Usage
1. Configure Prettier
Add to your package.json:
{
"prettier": "@bitforgehq/prettier-config"
}2. Sync .prettierignore (Optional but Recommended)
Sync the recommended .prettierignore file to your project:
bunx sync-prettier-ignoreOr add a script to your package.json:
{
"scripts": {
"prettier:sync-ignore": "sync-prettier-ignore"
}
}Then run:
bun run prettier:sync-ignoreThis creates a .prettierignore file in your project root with common ignore patterns for Angular/TypeScript projects.
Configuration
The config includes:
semi: true- Use semicolonssingleQuote: true- Use single quotesprintWidth: 100- Line length of 100 characterstrailingComma: "all"- Always add trailing commasarrowParens: "always"- Always include parentheses around arrow function parameterstabWidth: 2- Use 2 spaces for indentationuseTabs: false- Use spaces, not tabsendOfLine: "lf"- Use LF line endings
Scripts
Add these scripts to your package.json:
{
"scripts": {
"format": "prettier --write \"**/*.{ts,html,json,md,css,scss}\"",
"format:check": "prettier --check \"**/*.{ts,html,json,md,css,scss}\""
}
}Override
You can override specific settings by creating a .prettierrc file or adding a prettier field to your package.json:
{
"prettier": "@bitforgehq/prettier-config",
"prettierOverrides": {
"printWidth": 120
}
}Or use a .prettierrc.js file:
module.exports = {
...require("@bitforgehq/prettier-config"),
printWidth: 120,
};