import { RuleConfigSeverity, type UserConfig } from '@commitlint/types'; const Configuration: UserConfig = { ignores: [(commit) => commit.includes('init')], extends: ['@commitlint/config-conventional'], rules: { 'body-leading-blank': [RuleConfigSeverity.Error, 'always'], 'footer-leading-blank': [RuleConfigSeverity.Warning, 'always'], 'header-max-length': [RuleConfigSeverity.Error, 'always', 108], 'subject-empty': [RuleConfigSeverity.Error, 'never'], 'type-empty': [RuleConfigSeverity.Error, 'never'], 'type-enum': [RuleConfigSeverity.Error, 'always', ['feat', 'fix', 'perf', 'style', 'docs', 'test', 'refactor', 'build', 'ci', 'chore', 'revert']], }, prompt: { settings: {}, messages: { skip: '按 Enter 键可以跳过该字段', max: '最大字符数', min: '最小字符数', emptyWarning: '字段不能为空', upperLimitWarning: '超出字符限制', lowerLimitWarning: '字符小于下限', }, questions: { type: { description: '选择你要提交的变更类型:', enum: { feat: { description: '特性: ✨ 新增功能', title: '特征', emoji: '✨', }, fix: { description: '修复: 🐛 修复缺陷', title: 'bug修复', emoji: '🐛', }, docs: { description: '文档: 📝 文档变更(更新README文件,或者注释)', title: '文档', emoji: '📚', }, style: { description: '格式: 🌈 代码格式(空格、格式化、缺失的分号等)', title: '格式', emoji: '🌈', }, refactor: { description: '重构: 🔄 代码重构(不修复错误也不添加特性的代码更改)', title: '重构', emoji: '🔄', }, perf: { description: '性能: 🚀 性能优化', title: '性能', emoji: '🚀', }, test: { description: '测试: 🧪 添加疏漏测试或已有测试改动', title: '测试', emoji: '🧪', }, build: { description: '构建: 📦️ 构建流程、外部依赖变更(如升级 npm 包、修改 vite 配置等)', title: '依赖', emoji: '📦️', }, ci: { description: '集成: ⚙️ 修改 CI 配置、脚本', title: 'ci', emoji: '⚙️', }, chore: { description: '其他: 🛠️ 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)', title: 'Chores', emoji: '🛠️', }, revert: { description: '回退: ↩️ 回滚之前提交', title: '回退', emoji: '🗑', }, }, }, scope: { description: '这个更改的范围是什么(例如组件或文件名)', }, subject: { description: '写一个简短的,修改的变化描述', }, body: { description: '提供更长的变更描述', }, isBreaking: { description: '有什么突破性的变化吗?', }, breakingBody: { description: '一个破坏性变更提交需要一个主体。请输入更长的提交描述。', }, breaking: { description: '描述突破性的变化', }, isIssueAffected: { description: '这一变化是否会影响任何悬而未决的问题?', }, issuesBody: { description: '如果问题已关闭,则提交需要一个主体。请输入更长的提交描述', }, issues: { description: '添加问题引用(例如:“fix #123”,“re #123”。)', }, }, }, }; export default Configuration;