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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@aa-standard/commitlint-config

v1.0.2

Published

## 规范意义 1. 在阅读代码时(code review),通过commit message了解到代码编写的背景和作用 2. 修复bug时可以通过浏览commit message快速定位相关的提交记录以及对应代码

Downloads

4

Readme

@aa-standard/commitlint-config

规范意义

  1. 在阅读代码时(code review),通过commit message了解到代码编写的背景和作用
  2. 修复bug时可以通过浏览commit message快速定位相关的提交记录以及对应代码

参考资料

规范参考Angular(Conventional Commits 1.0.0)的git commit格式规范,并进行了一些扩展

阮一峰 Commit message 和 Change log 编写指南:https://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html

Angular git commit 规范原文:https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#heading=h.greljkmo14y0

格式说明

每次提交,Commit message 都包括三个部分:Header(必须),Body(可省略) 和 Footer(可省略)

<type, 必填>(<scope,可省略>): <subject,必填>
// 空一行
<body,可省略>
// 空一行
<footer,可省略>
  1. type(必填):用于说明 commit 的类别,只允许使用下面7个标识。
    • feat:新功能(feature)
    • fix:修补bug
    • i18n:修改国际化相关
    • UI:样式修改(不影响代码功能)
    • docs:文档(documentation)
    • style: 代码格式(不影响代码运行的变动)
    • refactor:重构(即不是新增功能,也不是修改bug的代码变动)
    • test:增加测试
    • chore:构建过程或辅助工具的变动
    • ...
  2. scope(可省略):用于说明 commit 影响的范围,比如某个模块、某个功能。
  3. subject(必填):是 commit 目的的简短描述(功能描述 + [#选填禅道号码]),不超过50个字符。
  4. body(可省略):部分是对本次 commit 的详细描述,可以分成多行。
  5. footer(可省略):部分只用于两种情况:不兼容变动、关闭 Issue。

举例

  1. feat: 增加内容(#33)
  2. fix(H5): 新增验证 (#99) // 注意 这里使用的":"是英文冒号

使用说明

前置依赖

  1. husky
  2. lint-stage
  3. @commitlint/cli

安装

npm install @commitlint/cli @aa-standard/commitlint-config

// or

yarn add @commitlint/cli @aa-standard/commitlint-config --dev

配置

执行 pnpm exec husky init 会生成.husky文件 文件下会有pre-commit 再创建commit-msg

    pnpm exec lint-staged
    pnpm exec commitlint --edit $1

使用时搭配git hooks工具完成提交前对commit message格式的校验

  • 使用vue-cli启动的项目,在package.json中增加
{
  "lint-staged": {
    "*.{js,jsx,vue}": [
      "pnpm exec eslint --fix"
    ],
    "*.{scss,less,styl,css,html,vue,jsx}": [
      "pnpm exec stylelint --fix"
    ]
  }
}