{"id":31970701,"url":"https://github.com/winjs-dev/commitlint-config-win","last_synced_at":"2025-10-14T19:18:22.374Z","repository":{"id":88652526,"uuid":"393419448","full_name":"winjs-dev/commitlint-config-win","owner":"winjs-dev","description":"Git 规约","archived":false,"fork":false,"pushed_at":"2023-08-15T09:24:40.000Z","size":557,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-04T15:18:45.189Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/winjs-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-06T15:28:49.000Z","updated_at":"2024-08-16T02:55:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"d85bc64f-6e17-47a0-808f-b3a0b1841d41","html_url":"https://github.com/winjs-dev/commitlint-config-win","commit_stats":null,"previous_names":["winjs-dev/commitlint-config-win"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/winjs-dev/commitlint-config-win","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winjs-dev%2Fcommitlint-config-win","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winjs-dev%2Fcommitlint-config-win/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winjs-dev%2Fcommitlint-config-win/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winjs-dev%2Fcommitlint-config-win/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/winjs-dev","download_url":"https://codeload.github.com/winjs-dev/commitlint-config-win/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winjs-dev%2Fcommitlint-config-win/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020656,"owners_count":26086895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-14T19:18:17.153Z","updated_at":"2025-10-14T19:18:22.370Z","avatar_url":"https://github.com/winjs-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @winner-fed/commitlint-config-win\n\n本包提供了《Git 规约》配套的 [commitlint 可共享配置](https://commitlint.js.org/#/concepts-shareable-config)，用于对 git commit message 进行校验。\n\n## 安装\n\n除了本包，你需要同时安装 [@commitlint/cli](https://www.npmjs.com/package/@commitlint/cli)：\n\n```bash\nnpm install @winner-fed/commitlint-config-win @commitlint/cli --save-dev\n```\n\n## 使用\n\n本包同时支持 CommonJS 和 ESM 模块系统。\n\n### CommonJS\n\n在项目中的 `commitlint.config.js` 中继承本包:\n\n```javascript\nmodule.exports = {\n  extends: ['@winner-fed/commitlint-config-win'],\n};\n```\n\n### ESM\n\n在项目中的 `commitlint.config.mjs` 中继承本包:\n\n```javascript\nexport default {\n  extends: ['@winner-fed/commitlint-config-win'],\n};\n```\n\n或者在 `package.json` 中设置 `\"type\": \"module\"` 后，在 `commitlint.config.js` 中使用：\n\n```javascript\nexport default {\n  extends: ['@winner-fed/commitlint-config-win'],\n};\n```\n\n### TypeScript\n\n如果你使用 TypeScript，可以在 `commitlint.config.ts` 中使用：\n\n```typescript\nimport type { UserConfig } from '@commitlint/types';\n\nconst config: UserConfig = {\n  extends: ['@winner-fed/commitlint-config-win'],\n};\n\nexport default config;\n```\n\n## 设置 git hook\n\n可通过 [husky](https://www.npmjs.com/package/husky) 设置在 git commit 时触发 commitlint。\n\n首先安装 husky：\n\n```bash\nnpm install husky --save-dev\n```\n\n然后在 `package.json` 中增加：\n\n```json\n{\n  \"husky\": {\n    \"hooks\": {\n      \"commit-msg\": \"commitlint -E HUSKY_GIT_PARAMS\"\n    }\n  }\n}\n```\n\n更多信息可参考 [commitlint 文档](https://commitlint.js.org/#/guides-local-setup?id=install-husky)。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinjs-dev%2Fcommitlint-config-win","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinjs-dev%2Fcommitlint-config-win","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinjs-dev%2Fcommitlint-config-win/lists"}