@exercism/babel-preset-typescript

中文文档
0.7.0发布于 2025/06/13MITCommonJS近 30 天下载 4557

Babel preset configuration for the TypeScript track & tooling on Exercism

原始使用文档

@exercism/babel-preset-typescript

This is the shared babel preset configuration used by the TypeScript track. Shareable configs are designed to work with the presets and plugins feature of .babelrc configuration files. This means you can use the same configuration you're used to on Exercism in your on projects!

⚠ It's customary to define dependencies such as @babel/core as peerDependency, so it's easy to determine its version by the including project, but because this preset is designed for end-usage, and we want to consolidate updating its dependencies in one place, we currently include these as hard dependencies.

You can still override the version included via the package-lock file, tools like shrinkwrap, or dependency resolution such as yarn provides.

Usage

To use the configuration, open your babel configuration file, and add the following value to presets. For example, for JSON based configuration files:

{
  "presets": ["@exercism/babel-preset-typescript"]
}

Configuration

Find the configuration here. It's goal is to enable babel's preset environment, and occasionally introduce experimental syntax before it becomes widely adopted (stage 3 and beyond, for those following TC39).

版本与发布记录

@exercism/babel-preset-typescript 共发布 7 个版本,首次发布于 2022/02/13;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.7.0latest2025/06/131.4 年前
0.6.02024/08/082 年前
0.5.02024/07/292 年前
0.4.02023/06/063 年前
0.2.12022/10/184 年前
0.2.02022/10/184 年前

关于 @exercism/babel-preset-typescript 的常见问题

@exercism/babel-preset-typescript 是什么?

Babel preset configuration for the TypeScript track & tooling on Exercism

如何安装 @exercism/babel-preset-typescript?

在项目目录运行 npm install @exercism/babel-preset-typescript,或使用 pnpm add / yarn add / bun add。

@exercism/babel-preset-typescript 支持 TypeScript 吗?

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

@exercism/babel-preset-typescript 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@exercism/babel-preset-typescript 可以商用吗?

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

@exercism/babel-preset-typescript 的下载量有多少?

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

@exercism/babel-preset-typescript 还在维护吗?

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