@chobotx/eslint-baseline

中文文档
0.9.6发布于 2024/07/02MITES Module近 30 天下载 2131

create a baseline for eslint pipelines

原始使用文档
文档目录3 节
  1. Why this over original @luminateone/eslint-baseline ?
  2. installation
  3. usage

eslint-baseline

Basic baseline checking for eslint in CI pipelines

Ever inherited project that never had any linting? Potentially hundreds/thousands of linting issues? This package allows you to create a baseline so you can insure your code quality on changes and deal with the existing issues on your own timeline

inspired by the phpstan baseline https://phpstan.org/user-guide/baseline

Why this over original @luminateone/eslint-baseline?

Unlike the original @luminateone/eslint-baseline package, the baseline does not depend on the line number but on the context of the error. Changes in the file rarely affect the baseline.

installation

npm install @chobotx/eslint-baseline

usage

The command is a simple wrapper around eslint so it will use all your existing config files and command line options as eslint

npx eslint-baseline file1.js

All command line arguments are passed through to eslint see https://eslint.org/docs/latest/user-guide/command-line-interface, the only caveat is the format is changed to json

If no baseline file exists one will be created on first run '.eslint-baseline.json'

Simply run a second time to verify if there are any new issues since the baseline was created

npx eslint-baseline file2.js

Do not forget to commit your .eslint-baseline.json file

Add the command to your CI pipeline to prevent code regressions

To recreate your baseline file, delete the existing file and rerun npx eslint-baseline

版本与发布记录

@chobotx/eslint-baseline 共发布 4 个版本,首次发布于 2024/05/30;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.9.6latest2024/07/022 年前
0.9.52024/05/302 年前
0.9.42024/05/302 年前
0.9.22024/05/302 年前

关于 @chobotx/eslint-baseline 的常见问题

@chobotx/eslint-baseline 是什么?

create a baseline for eslint pipelines

如何安装 @chobotx/eslint-baseline?

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

@chobotx/eslint-baseline 支持 TypeScript 吗?

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

@chobotx/eslint-baseline 支持 ESM 还是 CommonJS?

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

@chobotx/eslint-baseline 可以商用吗?

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

@chobotx/eslint-baseline 的下载量有多少?

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

@chobotx/eslint-baseline 还在维护吗?

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