@ansble/threepio

中文文档
1.10.0发布于 2026/03/17MITTypeScriptCommonJS构建来源已验证近 30 天下载 3337

I make code review easier for humans

原始使用文档
文档目录4 节
  1. Documentation
  2. Usage
  3. Configuration
  4. Creating a new lint

Threepio

I make code review easier for humans

Documentation

You can find the documentation for all the checks here

Usage

Add a github workflow and make sure that it looks similar to the one in this repo.

Here is an example that you can probably just drop in once you have installed the threepio npm package in dev dependencies:

name: Threepio Code Review Notes
on:
  pull_request:
    types: [opened, synchronize, edited]

jobs:
  comment:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js 20.x
        uses: actions/setup-node@v2
        with:
          node-version: 20.x
      - run: npm i
      - uses: actions/github-script@v6
        with:
          script: |
            const threepio = require('threepio')
            const res = await threepio.review(context, github)

            if (!res) {
              process.exit(1)
            }

Configuration

You can create a .threepio file in the root of a project using threepio to change the configuration per project. The .threepio file is a yaml file as described below. warning results in printing out the message in the comment but not in a failing build. error does the same thing, but also causes the build step to fail.

tests:
  jiraTickets: warning
  testPlanCheck: error
  allFilesTested: error
  checkMigrations: warn
  changeSizeCheck: warning

jira:
  projects:
    - DOOM
    - PLAT

rules:
  allFilesTested:
    exclude:
      - src/types.ts
      - src/test-helpers/index.ts

The rules section allows config to be passed to specific tests. The example above excludes certain files from the allFilesTested rule so that they won't show in the readout from it. For example there likely won't be tests for the src/types.ts file because it just contains types, so excluding it improves the signal to noise ratio of the comment.

Creating a new lint

Run: bin/new-lint

That will create all the files that you need, plus modify the imports in most of the places that you will need to import them to get them to work for you. All you will need to do is update the documentation in docs/rules.md, the lint code, its test file, and a couple of tests in other files that will start failing until you update them to account for the new lint you wrote.

版本与发布记录

@ansble/threepio 共发布 5 个版本,首次发布于 2025/01/15;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.10.0latest2026/03/177 个月前
1.9.02026/02/268 个月前
1.5.02025/04/101.6 年前
1.4.02025/02/061.7 年前
1.3.02025/01/151.8 年前

关于 @ansble/threepio 的常见问题

@ansble/threepio 是什么?

I make code review easier for humans

如何安装 @ansble/threepio?

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

@ansble/threepio 支持 TypeScript 吗?

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

@ansble/threepio 支持 ESM 还是 CommonJS?

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

@ansble/threepio 可以商用吗?

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

@ansble/threepio 的下载量有多少?

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

@ansble/threepio 还在维护吗?

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