npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gsc-basic/commitlint-config

v2.0.2

Published

Commitlint config for GSC Basic Team

Readme

@gsc-basic/commitlint-config

Commitlint Config for GSC Basic Team

DO NOT use it in your own project if you don't know what it's for

说明

Git commit内容检查工具,建议配合 husky 、 simple-git-hooks 等Git hooks tool使用。

使用

pnpm i @gsc-basic/commitlint-config husky -D

// commitlint.config.mjs
import createCommitlintConfig from '@gsc-basic/commitlint-config';

export default createCommitlintConfig();

默认配置的标题最大长度为 208、body 行宽为 508,Jira 号校验默认关闭。开启校验后,内置 type 中 feat、fix、perf、style、docs、refactor、workflow 的提交 subject 必须包含格式为 [A-Z][A-Z0-9]+-\d+ 的 Jira 号。additionalTypes 添加的自定义 type 也需要 Jira 号,除非通过 additionalJiraExemptTypes 将其加入豁免。内置豁免 type 为 chore、test、build、ci、types、conflict、revert、release、wip;release scope 和 Git 自动合并提交也不受此规则限制。

可以追加项目自定义 type,并调整标题最大长度和 body 行宽。追加的 type 不会替换内置列表:

// commitlint.config.mjs
import createCommitlintConfig from '@gsc-basic/commitlint-config';

export default createCommitlintConfig({
  additionalTypes: ['security'],
  additionalJiraExemptTypes: ['security'],
  headerMaxLength: 120,
  bodyMaxLineLength: 160,
  jiraNumberRequired: true,
});
  • additionalJiraExemptTypes 会在内置豁免 type 的基础上追加项目自定义豁免,不会替换内置列表。
  • bodyMaxLineLength 设置每行提交 body 的最大长度,默认值为 508。

如果项目不需要 Jira 号检查(默认行为),无需额外配置;也可以显式关闭:

// commitlint.config.mjs
import createCommitlintConfig from '@gsc-basic/commitlint-config';

export default createCommitlintConfig({ jiraNumberRequired: false });

从 1.x 升级到 2.x

2.x 将默认导出从静态配置对象改为配置工厂函数。请将旧的直接转出配置:

export { default } from '@gsc-basic/commitlint-config';

改为调用工厂函数:

import createCommitlintConfig from '@gsc-basic/commitlint-config';

export default createCommitlintConfig();

升级后,标题最大长度默认值从 108 变为 208。2.x 新增 Jira 号校验,但默认关闭;如需启用,请传入 jiraNumberRequired: true。项目自定义提交类型通过 additionalTypes 追加,内置类型仍会保留;如要豁免自定义 type 的 Jira 号要求,可使用 additionalJiraExemptTypes 追加。

// package.json
{
  "scripts": {
    "prepare": "husky"
  }
}

将依赖项提升到根模块目录

# .npmrc
public-hoist-pattern[]=@commitlint/*

添加Hook

husky使用文档参考:https://typicode.github.io/husky/

pnpm exec husky init

# .husky\commit-msg
echo Start running commit-msg hook...

pnpm exec commitlint --edit $1

echo Run commit-msg hook done.

Author & License

This package is maintained by Lenovo SSG BASD. It is distributed under the LicenseRef-Proprietary license; see LICENSE for details.