# @camunda/linting 中文文档

规范地址：https://npmcn.com/package/%40camunda/linting/

版本：4\.4\.0
npm 元数据更新时间：2026-10-27T14:42:49.125Z
中文译文更新时间：2026-11-09T00:48:07.625Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40camunda/linting
原文对照：https://npmcn.com/package/%40camunda/linting/?lang=original
项目主页：https://github.com/camunda/linting#readme
源码仓库：https://github.com/camunda/linting

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：106 kB，19 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- 运行依赖：12 个
- peer 依赖：bpmn-js-properties-panel \>= 2\.0\.0，@bpmn-io/properties-panel \>= 3\.56\.0
- 首次发布：2022-06-08T12:31:05.565Z
- 最新版本发布：2026-10-27T14:42:48.947Z
- 近 30 天下载量：20934（2026-10-09 至 2026-11-07，npm 官方下载统计）
- 已发布版本数：127（近 12 个月 23 个）

## 中文简介

向 Camunda 开火

## 安装

```sh
npm install @camunda/linting
```

也可以使用：`pnpm add @camunda/linting`、`yarn add @camunda/linting`、`bun add @camunda/linting`

## README

# @camunda/ linting (帮助)

[![CI](https://github.com/camunda/linting/actions/workflows/CI.yml/badge.svg)](https://github.com/camunda/linting/actions/workflows/CI.yml)

Camunda桌面和Web建模公司使用的 BPMN 接口 。 电池也包括在内

## 特征

-   捆绑 [bpmnlint (英语)](https://github.com/bpmn-io/bpmnlint) 财务报告和审定财务报表 [bpmnlint-plugin-camunda-compat 双相机](https://github.com/camunda/bpmnlint-plugin-camunda-compat/)
-   基于 `modeler:executionPlatform` 财务报告和审定财务报表 `modeler:executionPlatformVersion`
-   创建要在桌面和网络建模中显示的错误消息
-   创建要在属性面板中显示的错误
-   创建要在画布上显示的错误覆盖

## 使用量

```javascript
import Modeler from 'bpmn-js/lib/Modeler';

import { Linter } from '@camunda/linting';

import lintingModule from '@camunda/linting/modeler';

import '@camunda/linting/assets/linting.css';

const modeler = new Modeler({
  additionalModules: [
    lintingModule
  ]
});

// configure to be used with desktop or web modeler
const linter = new Linter({
  modeler: 'web', // `desktop` or `web` modeler, defaults to `desktop`
  type: 'cloud' // `cloud` or `platform` diagrams, defaults to `cloud`
});

// lint by passing definitions
const reports = await linter.lint(definitions);

// or passing XML
const reports = await linter.lint(xml);

...

// update errors on canvas and in properties panel (requires bpmn-js-properties-panel >= 1.3.0)
modeler.get('linting').setErrors(reports);

// show error by selecting element and properties panel entry
modeler.get('linting').showError(report);

// activate and deactivate errors on canvas
modeler.get('linting').activate();
modeler.get('linting').deactivate();
```

## 发展

```sh
# install
npm i

# run tests
npm t

# run tests in watch mode
npm run test:watch

# run example
npm start
```

## 许可证

麻省理工学院

## 常见问题

### @camunda/linting 是什么？

向 Camunda 开火

### 如何安装 @camunda/linting？

在项目目录运行 npm install @camunda/linting，或使用 pnpm add / yarn add / bun add。

### @camunda/linting 支持 TypeScript 吗？

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

### @camunda/linting 支持 ESM 还是 CommonJS？

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

### @camunda/linting 可以商用吗？

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

### @camunda/linting 的下载量有多少？

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

### @camunda/linting 还在维护吗？

最新版本 4\.4\.0 发布于 2026/10/27（12 天前）；至今共发布 127 个版本，其中过去 12 个月发布了 23 个；首次发布于 2022/06/08。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

