@acamarata/prettier-config
v0.1.0
Published
Shared Prettier configuration for acamarata packages.
Maintainers
Readme
@acamarata/prettier-config
Shared Prettier configuration for acamarata JavaScript and TypeScript packages.
Install
npm install --save-dev @acamarata/prettier-config prettierOr with pnpm:
pnpm add -D @acamarata/prettier-config prettierPrettier 3.x is required as a peer dependency.
Usage
Reference the package in your package.json:
{
"prettier": "@acamarata/prettier-config"
}That is all you need for the defaults. Prettier reads the prettier field and loads the config automatically.
Defaults
| Option | Value |
|---|---|
| printWidth | 100 |
| tabWidth | 2 |
| useTabs | false |
| singleQuote | false |
| trailingComma | "all" |
| semi | true |
| bracketSpacing | true |
| arrowParens | "always" |
| endOfLine | "lf" |
File-type overrides
| File pattern | Override |
|---|---|
| *.md, *.mdx | printWidth: 80, proseWrap: "always", trailingComma: "none" |
| *.json, *.jsonc | trailingComma: "none" |
| *.yaml, *.yml | singleQuote: true, trailingComma: "none" |
Extending
If you need to override specific options, use a prettier.config.mjs file in your project:
import acamarataConfig from "@acamarata/prettier-config";
/** @type {import("prettier").Config} */
export default {
...acamarataConfig,
// Your overrides here
printWidth: 120,
};Note: the prettier field in package.json does not support extending. Use a config file
when you need project-specific overrides.
License
MIT
