@forsakringskassan/commitlint-config

中文文档
4.2.8发布于 2026/08/17MITES Module构建来源已验证近 30 天下载 4.7万

FK commitlint shareable config

原始使用文档
文档目录5 节
  1. Install
  2. Configuration
  3. Adding hooks
  4. Before installing this plugin
  5. Debug mode

@forsakringskassan/commitlint-config

Based on Conventional Commits with additional checks for JIRA.

[optional scope]: ()

[optional body]

[optional footer(s)]

  1. fix: fixes a bug and results in a PATCH release.
  2. feat: introduces a new feature and results in a MINOR release.
  3. BREAKING CHANGE: in the footer followed by a description results in a MAJOR release. The description is added to the changelog.
  4. types other than fix and feat is allowed, see list at @commitlint/config-conventional
  5. (fixes XYZ-123) or (refs XYZ-123) JIRA reference must be included after subject.

Install

$ npm install --save-dev @forsakringskassan/commitlint-config

This package bundles @commitlint/cli so it does not have to be installed separately.

Configuration

This package provides two variants:

  • @forsakringskassan/commitlint-config/default
  • @forsakringskassan/commitlint-config/no-jira

The default configuration enforces a JIRA reference at the end of the header. The no-jira variant does not enforce it.

npm pkg set commitlint.extends=@forsakringskassan/commitlint-config/default

or manually edit package.json:

{
    "commitlint": {
        "extends": "@forsakringskassan/commitlint-config/default"
    }
}

Adding hooks

This package also provides the following git hooks:

  • Prettier and Esbuild will run before a commit is created (if the packages exist in your application).
  • The commit message will be validated.

To validate commit messages as commits are created, you also need to set up the Git hooks.

$ npm pkg set scripts.prepare="commitlint-config"

or manually edit your package.json

{
    "scripts": {
        "prepare": "commitlint-config"
    }
}

Before installing this plugin

If you already have husky, simple-git-hooks or lint-staged in your package.json you need uninstall them first:

npm rm lint-staged husky simple-git-hooks

Debug mode

You can add --debug when calling commitlint-config in order to get debug information which could be useful when troubleshooting.

版本与发布记录

@forsakringskassan/commitlint-config 共发布 73 个版本,首次发布于 2024/02/29;过去 12 个月发布了 40 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
4.2.8latest2026/08/172 个月前
4.2.72026/08/043 个月前
4.2.62026/08/043 个月前
4.2.52026/07/303 个月前
4.2.42026/07/273 个月前
4.2.32026/07/263 个月前

关于 @forsakringskassan/commitlint-config 的常见问题

@forsakringskassan/commitlint-config 是什么?

FK commitlint shareable config

如何安装 @forsakringskassan/commitlint-config?

在项目目录运行 npm install @forsakringskassan/commitlint-config,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 commitlint、lint-staged、commitlint-config,可以用 npx commitlint 直接运行。

@forsakringskassan/commitlint-config 支持 TypeScript 吗?

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

@forsakringskassan/commitlint-config 支持 ESM 还是 CommonJS?

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

@forsakringskassan/commitlint-config 需要什么版本的 Node.js?

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

@forsakringskassan/commitlint-config 可以商用吗?

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

@forsakringskassan/commitlint-config 的下载量有多少?

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

@forsakringskassan/commitlint-config 还在维护吗?

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