@cosyte/prettier-config
One formatter setting sheet for every Cosyte repository, adopted in a single line.
Shared Prettier configuration for @cosyte/* packages.
Why this exists
Formatting is the one thing a code review should never be about, and a per-repo .prettierrc makes
it about that anyway: two repositories disagree by one setting, a contributor moves between them,
and every diff carries reformatting noise that hides the change.
The nearest alternative is committing the same .prettierrc everywhere. That is the drift this
removes: adopting the settings is one package.json field, and changing them is a version bump
rather than ten pull requests.
Status
@cosyte/prettier-config is on the Cosyte 0.1.x line: the public API is settled and bump types follow ordinary semver.
Still moving: the printWidth and the per-filetype overrides. Both are the kind of setting that
reformats an entire repository when it changes, so a consumer that cares should pin an exact version
and take the reformat deliberately.
Install
pnpm add -D @cosyte/prettier-config prettier
prettier is a peer dependency. Node >=22.14. The package ships one JSON file and no code.
Usage
In package.json:
{ "prettier": "@cosyte/prettier-config" }
Then format and check as usual:
pnpm exec prettier --write "**/*.{js,mjs,ts,json,md,yml,yaml}"
pnpm exec prettier --check "**/*.{js,mjs,ts,json,md,yml,yaml}"
Keep the two globs identical. A --write that covers a file --check does not is a formatting
violation that can never fail CI, which is how a repository ends up with a green check over files
nobody reads.
Entry points
| entry point | what it is |
|---|---|
@cosyte/prettier-config | the config object itself (index.json), ready for the prettier field above |
There is no JavaScript entry point, because the package is one JSON file a tool reads rather than a module a consumer calls. That is also why no example here is executed by this repository's test run: there is nothing to call.
Overrides
Every key is overridable: Prettier has no enforcement of its own, so a divergence costs nothing but
the divergence. Point the prettier field at your own module and spread this one, which is the
shape Prettier supports for extending a shared config:
// prettier.config.js
import cosyte from "@cosyte/prettier-config" with { type: "json" };
export default { ...cosyte, printWidth: 80 };
Prefer changing it here and taking a version bump. A per-repo override is a formatting dialect, and the point of a shared config is that there is one.
PHI and safety
This package is formatter configuration. It contains no code, reads no input, and never sees patient data: it is one JSON file Prettier reads. Nothing here logs, retains or transmits anything.
Compatibility
printWidth 100, double quotes, semicolons, trailing commas, arrowParens: always, and LF line
endings, with the standard *.md, JSON and YAML overrides. proseWrap is preserve, so Prettier
reflows no prose: a markdown line stays where its author put it.
Contributing
Questions, bug reports and proposals go to the issue tracker. Pull requests are welcome, in cosyte/config, where this package lives.
A change has to clear the required verify job, and a change to a setting here needs a changeset
saying what moved: every consumer reformats on the version bump.
License
MIT, copyright Cosyte LLC. See LICENSE.