Holepunch Prettier Config

raw JSON →
2.0.0 verified Sat Apr 25 auth: no javascript

Shared Prettier configuration used by Holepunch projects. Version 2.0.0 requires Prettier ^3.6.2. Provides a standardized set of formatting options for consistent code style across Holepunch repositories. Simple to use by referencing the package name in .prettierrc.

error Cannot find module 'prettier-config-holepunch'
cause Package not installed or not in node_modules.
fix
Run: npm install --save-dev prettier-config-holepunch
error Configuration file .prettierrc contains an invalid option: prettier-config-holepunch
cause Using the package name as a key instead of a string value.
fix
Change .prettierrc to: "prettier-config-holepunch"
breaking Version 2.0.0 requires Prettier ^3.6.2, which may have breaking changes from Prettier 2.x.
fix Update Prettier to 3.6.2 or later.
gotcha Do not use require() or import to load this config; it must be a string in .prettierrc.
fix Set .prettierrc to the string "prettier-config-holepunch".
gotcha If you override options, you may lose the shared defaults; merge carefully.
fix Use extends or spread to preserve base config.
npm install prettier-config-holepunch
yarn add prettier-config-holepunch
pnpm add prettier-config-holepunch

Shows how to extend the shared Prettier config in .prettierrc file.

// .prettierrc
"prettier-config-holepunch"

// Then format with:
// npx prettier --check .
// npx prettier --write .