@cosyte/prettier-config

中文文档
0.1.2发布于 2026/11/08MIT零依赖构建来源已验证近 30 天下载 5801

Shared Prettier configuration for @cosyte/* packages.

原始使用文档
文档目录10 节
  1. Why this exists
  2. Status
  3. Install
  4. Usage
  5. Entry points
  6. Overrides
  7. PHI and safety
  8. Compatibility
  9. Contributing
  10. License
The Cosyte logo on its own white ground: the icon beside the word Cosyte.

@cosyte/prettier-config

One formatter setting sheet for every Cosyte repository, adopted in a single line.

npm version CI License: MIT Node

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 pointwhat it is
@cosyte/prettier-configthe 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.

版本与发布记录

@cosyte/prettier-config 共发布 7 个版本,首次发布于 2026/06/25;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.2latest2026/11/082 天前
0.1.12026/11/083 天前
0.1.02026/09/211 个月前
0.0.42026/08/053 个月前
0.0.32026/07/313 个月前
0.0.22026/06/264 个月前

关于 @cosyte/prettier-config 的常见问题

@cosyte/prettier-config 是什么?

Shared Prettier configuration for @cosyte/* packages.

如何安装 @cosyte/prettier-config?

在项目目录运行 npm install @cosyte/prettier-config,或使用 pnpm add / yarn add / bun add。

@cosyte/prettier-config 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/cosyte__prettier-config 是否存在。

@cosyte/prettier-config 可以商用吗?

@cosyte/prettier-config 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@cosyte/prettier-config 的下载量有多少?

根据 npm 官方下载统计,@cosyte/prettier-config 在 2026/10/11 – 2026/11/09 这 30 天内被下载 5,801 次,日均约 193 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cosyte/prettier-config 还在维护吗?

最新版本 0.1.2 发布于 2026/11/08(2 天前);至今共发布 7 个版本,其中过去 12 个月发布了 7 个;首次发布于 2026/06/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。