@dhis2/cli-style

中文文档
10.7.10发布于 2026/04/09BSD-3-ClauseTypeScriptCommonJS近 30 天下载 8977

The code and commit style for DHIS2.

原始使用文档
文档目录3 节
  1. Batteries included
  2. Usage
  3. Report an issue

cli-style

This package is part of the @dhis2/cli commandline interface.

dhis2-cli Compatible @dhis2/cli-style on npm Conventional Commits

Docs are available at cli-style.dhis2.nu.

Batteries included

This tool is part of the dhis2/cli suite, but can also be used standalone which is useful for project level integration.

As a terminal user check out the full CLI. :rocket:

This tool includes the following tools as runtime dependencies, so they are not necessary to explicitly install:

Usage

yarn d2-style --help

yarn d2-style install --help

yarn d2-style check --help
yarn d2-style check js --help

yarn d2-style apply --help
yarn d2-style apply text --help

Report an issue

The issue tracker can be found in DHIS2 JIRA under the CLI project.

Deep links:

版本与发布记录

@dhis2/cli-style 共发布 130 个版本,首次发布于 2019/01/29;过去 12 个月发布了 1 个版本。

版本发布日期距今
10.7.10latest2026/04/097 个月前
10.7.92025/06/261.4 年前
10.7.82025/05/281.5 年前
10.7.72025/04/031.6 年前
10.7.62025/02/041.8 年前
10.7.52024/10/282 年前

其他发布通道:next → 10.1.0,alpha → 10.8.0-alpha.1。

关于 @dhis2/cli-style 的常见问题

@dhis2/cli-style 是什么?

The code and commit style for DHIS2.

如何安装 @dhis2/cli-style?

在项目目录运行 npm install @dhis2/cli-style,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 d2-style,可以用 npx d2-style 直接运行。

@dhis2/cli-style 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@dhis2/cli-style 支持 ESM 还是 CommonJS?

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

@dhis2/cli-style 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=12。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@dhis2/cli-style 可以商用吗?

@dhis2/cli-style 使用 BSD-3-Clause 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。另外不得用原作者名义为衍生产品背书。以上为概括,不构成法律意见,请以许可原文为准。

@dhis2/cli-style 的下载量有多少?

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

@dhis2/cli-style 还在维护吗?

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