chore: 将 husky 钩子中的 pnpm 替换为 npm 并更新 commitlint 配置格式

将 husky 的 pre-commit 和 commit-msg 钩子中的包管理器从 pnpm 改为 npm,以统一使用 npm 执行脚本
This commit is contained in:
houakang
2026-04-10 10:42:39 +08:00
parent c738e638cf
commit 44c581dd44

View File

@@ -1,21 +1,21 @@
module.exports = { export default {
extends: ['@commitlint/config-conventional'], extends: ['@commitlint/config-conventional'],
rules: { rules: {
'type-enum': [ 'type-enum': [
2, 2,
'always', 'always',
[ [
'feat', // 新功能 'feat', // 新功能
'fix', // 修复 bug 'fix', // 修复 bug
'docs', // 文档变更 'docs', // 文档变更
'style', // 代码格式(不影响代码运行的变动) 'style', // 代码格式(不影响代码运行的变动)
'refactor', // 重构(既不是新增功能,也不是修改 bug 的代码变动) 'refactor', // 重构(既不是新增功能,也不是修改 bug 的代码变动)
'perf', // 性能优化 'perf', // 性能优化
'test', // 添加测试或修改现有测试 'test', // 添加测试或修改现有测试
'chore', // 构建过程或辅助工具的变动 'chore', // 构建过程或辅助工具的变动
'ci', // CI 配置文件和脚本的变动 'ci', // CI 配置文件和脚本的变动
'build', // 影响构建系统或外部依赖的更改 'build', // 影响构建系统或外部依赖的更改
'revert', // 回滚提交 'revert', // 回滚提交
], ],
], ],
'type-case': [2, 'always', 'lower-case'], 'type-case': [2, 'always', 'lower-case'],
@@ -24,4 +24,4 @@ module.exports = {
'subject-full-stop': [2, 'never', '.'], 'subject-full-stop': [2, 'never', '.'],
'header-max-length': [2, 'always', 100], 'header-max-length': [2, 'always', 100],
}, },
}; }