@cffnpwr/tsconfig

中文文档
1.0.0发布于 2026/07/09MITES Module零依赖构建来源已验证近 30 天下载 3433

Shared TypeScript base configurations for cffnpwr

原始使用文档
文档目录13 节
  1. Configurations
  2. How to Install
  3. npm
  4. pnpm
  5. Bun
  6. Deno
  7. How to Use
  8. What base.json sets and why
  9. Module system
  10. Emit
  11. Strictness
  12. Intentionally left to the linter
  13. License

@cffnpwr/tsconfig

GitHub License npm Version JSR Version

Shared TypeScript base configurations for cffnpwr.

日本語のREADMEはこちら

Configurations

FileExtendsAddsUse for
base.json–strict + module setRuntime-agnostic base to extend from
bun.jsonbase.jsontypes: ["bun"]Bun projects
node.jsonbase.jsontypes: ["node"]Node.js projects

base.json deliberately does not set types, include, or exclude. The environment variants only add the ambient types; everything else is inherited.

How to Install

npm

npm install -D @cffnpwr/tsconfig

or

npx jsr add -D @cffnpwr/tsconfig

pnpm

pnpm add -D @cffnpwr/tsconfig

or

pnpm dlx jsr add -D @cffnpwr/tsconfig

Bun

bun add -D @cffnpwr/tsconfig

or

bunx jsr add -D @cffnpwr/tsconfig

Deno

deno add -D npm:@cffnpwr/tsconfig

or

deno add -D jsr:@cffnpwr/tsconfig

How to Use

Create a tsconfig.json and extend the variant that matches your runtime. include/exclude are not provided, so set them per project.

Bun:

{
  "extends": "@cffnpwr/tsconfig/bun",
  "include": ["src", "*.config.ts"]
}

Node.js:

{
  "extends": "@cffnpwr/tsconfig/node",
  "include": ["src"]
}

For any other runtime, extend base and set types yourself:

{
  "extends": "@cffnpwr/tsconfig/base",
  "compilerOptions": {
    "types": ["@cloudflare/workers-types"]
  },
  "include": ["src"]
}

What base.json sets and why

Module system

OptionValueWhy
target / libESNextLatest syntax and library types; downleveling is the bundler's job.
modulePreserveKeeps import/require as written and implies moduleResolution: bundler.
moduleResolutionbundlerResolution model matching Bun/Vite/tsdown. Set explicitly even though Preserve implies it.
moduleDetectionforceTreats every non-.d.ts file as a module, avoiding accidental global-script scope.
esModuleInteroptrueInterop for CJS default imports (type-checking behavior under Preserve).
verbatimModuleSyntaxtrueForces explicit import type; no implicit import elision.
isolatedModulestrueGuarantees each file transpiles safely on its own (single-file transpilers, ts.transpileModule).
allowImportingTsExtensionstrueAllows importing .ts paths. Requires noEmit (or emitDeclarationOnly), satisfied below.
resolveJsonModuletrueAllows importing .json.

Emit

OptionValueWhy
noEmittruetsc is used for type-checking only; the build is done by a bundler (Bun / tsdown / Vite).
declaration / declarationMaptrueOnly take effect when a consumer sets noEmit: false to emit .d.ts via tsc. Under the default noEmit: true they emit nothing. Kept so that turning emit on yields declarations without extra config.

Strictness

OptionValueWhy
stricttrueFull strict family.
noUncheckedIndexedAccesstrueAdds undefined to index-signature access results.
noImplicitOverridetrueRequires override on overriding members.
noImplicitReturnstrueFlags code paths that don't return a value.
noFallthroughCasesInSwitchtrueFlags non-empty switch cases that fall through.
skipLibChecktrueSkips type-checking of .d.ts files for faster builds.

Intentionally left to the linter

noUnusedLocals, noUnusedParameters, and noPropertyAccessFromIndexSignature are not set here. Unused-symbol and index-access reporting is handled by @cffnpwr/eslint-config, so the type-checker does not duplicate it.

License

MIT License

版本与发布记录

@cffnpwr/tsconfig 共发布 2 个版本,首次发布于 2026/07/08;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.0.0latest2026/07/094 个月前
0.0.02026/07/084 个月前

关于 @cffnpwr/tsconfig 的常见问题

@cffnpwr/tsconfig 是什么?

Shared TypeScript base configurations for cffnpwr

如何安装 @cffnpwr/tsconfig?

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

@cffnpwr/tsconfig 支持 TypeScript 吗?

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

@cffnpwr/tsconfig 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@cffnpwr/tsconfig 可以商用吗?

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

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

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

@cffnpwr/tsconfig 还在维护吗?

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