@fuf-stack/typescript-config

中文文档
0.6.0发布于 2026/10/22MITES Module零依赖构建来源已验证近 30 天下载 3598

typescript configs for a Fröhlich ∧ Frei repo

原始使用文档
文档目录6 节
  1. @fuf-stack/typescript-config
  2. Presets
  3. Install
  4. Usage
  5. Notes
  6. License

@fuf-stack/typescript-config

TypeScript config presets for Fröhlich ∧ Frei projects. These JSON configs help standardize compiler options across apps and packages in a monorepo.

Presets

  • base.json: Strict defaults for libraries and packages (ES2022 target and standard APIs, ESNext modules, Bundler resolution, declarations, strict type checking)
  • eslint.json: Variant for ESLint parsing (inherits the ES2022 baseline, noEmit, allowJs)
  • react-library.json: Library-focused React settings (inherits the ES2022 target, ES2022 and DOM libs, jsx: react-jsx)
  • react-vite-app.json: App-focused React + Vite settings (inherits the ES2022 target, ES2022 and DOM libs, jsx: react-jsx, noUnused* enabled)

Install

# pnpm
pnpm add -D @fuf-stack/typescript-config

# npm
npm i -D @fuf-stack/typescript-config

# yarn
yarn add -D @fuf-stack/typescript-config

Usage

Reference a preset from your tsconfig.json files.

  • Package/library
{
  "extends": "@fuf-stack/typescript-config/base.json",
  "compilerOptions": {
    "outDir": "dist"
  },
  "include": ["src"]
}
  • React app (Vite)
{
  "extends": "@fuf-stack/typescript-config/react-vite-app.json",
  "include": ["src", "vite.config.ts"]
}
  • React library
{
  "extends": "@fuf-stack/typescript-config/react-library.json",
  "include": ["src"]
}
  • ESLint-only config
// tsconfig.eslint.json
{
  "extends": "@fuf-stack/typescript-config/eslint.json",
  "include": [
    "**/*.ts",
    "**/*.tsx",
    ".eslintrc.*",
    "prettier.config.*",
    "vite.config.*",
    "vitest.config.*",
    "vitest.workspace.*"
  ]
}

Notes

  • All four presets target ES2022. The base and ESLint presets include ES2022 standard API types; the React presets also include DOM types. TypeScript 6 includes DOM iterable types in DOM.
  • Runtimes must support the APIs you use; lib provides types, not polyfills. React libraries now emit ES2022 syntax instead of ES6, so consumers must support ES2022 or transpile the output.
  • For Vite apps, configure Vite's build.target separately to match your supported browsers.
  • Presets use modern options like module: ESNext and moduleResolution: Bundler by default.
  • Adjust include, exclude, and paths as needed per project.

License

MIT

版本与发布记录

@fuf-stack/typescript-config 共发布 8 个版本,首次发布于 2024/12/27;过去 12 个月发布了 3 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.6.0latest2026/10/2224 天前
0.5.02026/05/205 个月前
0.4.02025/11/1811 个月前
0.3.02025/01/061.9 年前
0.2.02024/12/271.9 年前
0.1.22024/12/271.9 年前

关于 @fuf-stack/typescript-config 的常见问题

@fuf-stack/typescript-config 是什么?

typescript configs for a Fröhlich ∧ Frei repo

如何安装 @fuf-stack/typescript-config?

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

@fuf-stack/typescript-config 支持 TypeScript 吗?

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

@fuf-stack/typescript-config 支持 ESM 还是 CommonJS?

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

@fuf-stack/typescript-config 可以商用吗?

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

@fuf-stack/typescript-config 的下载量有多少?

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

@fuf-stack/typescript-config 还在维护吗?

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