@cosyte/tsconfig

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

Shared TypeScript 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/tsconfig

Two TypeScript configs, one strictness bar, no per-repo copy to drift.

npm version CI License: MIT Node

Shared TypeScript configuration for @cosyte/* packages.

Why this exists

A tsconfig.json copied into ten repositories is ten strictness bars. One of them relaxes exactOptionalPropertyTypes to unblock a release, the relaxation stays, and two packages now disagree about what their types promise.

The nearest alternative is a template file the scaffolder copies, and it is not this: fixing a template fixes no repository that already exists. This is a published package, so raising the bar reaches every consumer as a version bump and pnpm install.

Status

@cosyte/tsconfig is on the Cosyte 0.1.x line: the public API is settled and bump types follow ordinary semver.

The two config names (base.json, library.json) are stable in practice, but the option set inside them is not: compiler options are added as TypeScript ships them and as the parsers find gaps, and each addition can red a consumer's build. Pin an exact version if that matters to you.

Install

pnpm add -D @cosyte/tsconfig typescript

typescript is a peer dependency. Node >=22.14. The package ships two JSON files and no code.

Usage

Two configs:

  • base.json: the type-check baseline (no emit). Extend this for tsc --noEmit.
  • library.json: base.json plus declaration and sourcemap emit, for building a publishable library.

tsconfig.json (type-check, set your own outDir / noEmit / include):

{
  "extends": "@cosyte/tsconfig/base.json",
  "compilerOptions": { "noEmit": true },
  "include": ["src", "test"],
}

tsconfig.build.json (emit a library):

{
  "extends": "@cosyte/tsconfig/library.json",
  "compilerOptions": { "outDir": "dist", "rootDir": "src" },
  "include": ["src"],
}

Entry points

Two configs, and the root specifier @cosyte/tsconfig deliberately resolves to neither: a tsconfig.json names the file it extends, so each one is reached by its own subpath.

entry pointwhat it is
@cosyte/tsconfig/base.jsonthe type-check baseline, no emit. Extend this for tsc --noEmit
@cosyte/tsconfig/library.jsonbase.json plus declaration and sourcemap emit, for building a published lib

Both are JSON files the compiler reads, so neither carries an example this repository's test run executes: there is nothing to call.

Overrides

Anything in compilerOptions is overridable by declaring it again in the extending file, which is how outDir, rootDir, noEmit and include are meant to be set. TypeScript resolves the nearest declaration, so your value wins over the one inherited from here.

Turning a rigor flag back off is the one override to think twice about. It is not blocked, and nothing here can block it, but it silently widens what every downstream @cosyte/* consumer of your types is allowed to assume. Change it here and take a version bump instead, so the whole suite moves together.

PHI and safety

This package is build configuration. It contains no code, reads no input, and never sees patient data: it is two JSON files the TypeScript compiler reads. Nothing here logs, retains or transmits anything.

Compatibility

Strict, ES2023, NodeNext, with the full rigor set (noUncheckedIndexedAccess, exactOptionalPropertyTypes, noPropertyAccessFromIndexSignature, and more). NodeNext module resolution means a consumer needs a TypeScript new enough to understand it, and dual-published packages should verify their emitted types with @arethetypeswrong/cli.

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 this package needs a changeset saying what moved: a compiler option added here reds every consumer that was passing without it.

License

MIT, copyright Cosyte LLC. See LICENSE.

版本与发布记录

@cosyte/tsconfig 共发布 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/tsconfig 的常见问题

@cosyte/tsconfig 是什么?

Shared TypeScript configuration for @cosyte/* packages.

如何安装 @cosyte/tsconfig?

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

@cosyte/tsconfig 支持 TypeScript 吗?

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

@cosyte/tsconfig 可以商用吗?

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

@cosyte/tsconfig 的下载量有多少?

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

@cosyte/tsconfig 还在维护吗?

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