{"id":18663216,"url":"https://github.com/pskfyi/commitlint-config-monorepo","last_synced_at":"2025-06-11T12:35:01.708Z","repository":{"id":49674006,"uuid":"203653345","full_name":"pskfyi/commitlint-config-monorepo","owner":"pskfyi","description":"Scope-focused, shareable commitlint config ","archived":false,"fork":false,"pushed_at":"2021-06-11T00:53:36.000Z","size":25,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T05:34:42.659Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pskfyi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-21T19:43:42.000Z","updated_at":"2023-09-02T06:59:12.000Z","dependencies_parsed_at":"2022-09-10T16:00:27.582Z","dependency_job_id":null,"html_url":"https://github.com/pskfyi/commitlint-config-monorepo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pskfyi%2Fcommitlint-config-monorepo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pskfyi%2Fcommitlint-config-monorepo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pskfyi%2Fcommitlint-config-monorepo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pskfyi%2Fcommitlint-config-monorepo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pskfyi","download_url":"https://codeload.github.com/pskfyi/commitlint-config-monorepo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248483077,"owners_count":21111419,"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","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":"2024-11-07T08:15:42.088Z","updated_at":"2025-04-11T21:32:05.417Z","avatar_url":"https://github.com/pskfyi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# commitlint-config-monorepo\n\nA mixin `commitlint` config intended for monorepos. Makes (scope)s required and forces you to be explicit about which (scope) values are allowed. Intended to be used with another config as the base.\n\n## Differences from Conventional Commits\n\nInvalid:\n\n```sh\necho \"fix: some message\" # a (scope) is required\n```\n\nValid:\n\n```sh\necho \"fix(docs): Sandbox re-renders as expected\"\n```\n\n## Getting started\n\n\u003e **note:** see [this gist](https://gist.github.com/pskfyi/497fbcc10a0625c716d30995fe336947) for setting up commitlint and husky.\n\n```sh\nnpm i -D commitlint-config-monorepo\n```\n\nIn `commitlint.config.js` at the root of your repo:\n\n```js\nmodule.exports = {\n  extends: [\"some-other-base-config\", \"monorepo\"],\n  rules: {\n    \"scope-enum\": [\n      2, // throw error\n      \"always\",\n      [\n        // This is the only default value baked into the config.\n        \"repo\",\n      ],\n    ],\n  },\n};\n```\n\n### Advanced Configuration\n\nThis configuration dynamically reads subdirectories of `/packages` and makes them valid (scope)s. Ex. if you have a subdirectory `/packages/components/` this would make \"components\" a valid (scope).\n\n```js\nconst { readdirSync: readDirectory } = require(\"fs\");\nconst DEFAULT_SCOPES = [\"repo\"];\n\nconst packageDirNames = readDirectory(\"./packages\", { withFileTypes: true })\n  .filter((entry) =\u003e entry.isDirectory())\n  .map((dir) =\u003e dir.name);\n\nconst scopes = DEFAULT_SCOPES.concat(packageDirNames);\n\nmodule.exports = {\n  extends: [\"monorepo\"],\n  rules: {\n    \"scope-enum\": [2, \"always\", scopes],\n  },\n};\n```\n\n## FAQ\n\n### Why not `@commitlint/config-conventional`?\n\n- This minimal ruleset is meant to be added to another config. Use it with `@commitlint/config-conventional` if you want!\n\n- Mandatory scope provides consistency and discourages haphazard commits that would apply to multiple scopes.\n\n### Why not use `@commitlint/config-lerna-scopes` or a similar pattern?\n\n- Being forced to be explicit about which scopes are allowed makes you more aware of them.\n\n- Desire to call out non-package scopes; ex. the config defaults to \"repo\" as a scope.\n\n- Lerna package names can sometimes be more verbose than is desirable in a commit message; '@my-org-name/projectname-packagename' is a common pattern, and `@commitlint/config-lerna-scopes` will only trim off '@my-org-name'\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpskfyi%2Fcommitlint-config-monorepo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpskfyi%2Fcommitlint-config-monorepo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpskfyi%2Fcommitlint-config-monorepo/lists"}