1 Star 0 Fork 29

lokidev/vuepress-theme-hope

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
commitlint.config.ts 866 Bytes
一键复制 编辑 原始数据 按行查看 历史
Mister-Hope 提交于 2024-04-22 17:20 . chore: update commitlintrc
import { execSync } from "node:child_process";
import { readdirSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import type { UserConfig } from "cz-git";
const packages = readdirSync(
join(dirname(fileURLToPath(import.meta.url)), "./packages/"),
);
const scopeComplete = execSync("git status --porcelain || true")
.toString()
.trim()
.split("\n")
.find((r) => ~r.indexOf("M packages"))
?.replace(/\//g, "%%")
?.match(/packages%%((\w|-)*)/)?.[1];
export default {
extends: ["@commitlint/config-conventional"],
rules: {
"scope-enum": [2, "always", ["demo", "release", ...packages]],
},
prompt: {
defaultScope: scopeComplete,
customScopesAlign: !scopeComplete ? "top" : "bottom",
allowCustomIssuePrefix: false,
allowEmptyIssuePrefix: false,
},
} as UserConfig;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/lokidev/theme.git
git@gitee.com:lokidev/theme.git
lokidev
theme
vuepress-theme-hope
main

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385