├── .codesandbox └── ci.json ├── .devcontainer └── devcontainer.json ├── .editorconfig ├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── BUG_REPORT.yml │ ├── FEATURE_REQUEST.yml │ └── config.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── CI.yml │ ├── container-build.yml │ └── docs-deploy.yml ├── .gitignore ├── .husky ├── commit-msg └── pre-commit ├── .npmrc ├── .nvmrc ├── .nxignore ├── .prettierignore ├── .tool-versions ├── .vscode ├── launch.json └── settings.json ├── .yarnrc ├── @alias ├── commitlint-config-angular │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ ├── license.md │ └── package.json ├── commitlint-config-lerna-scopes │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ ├── license.md │ └── package.json ├── commitlint-config-nx-scopes │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ ├── license.md │ └── package.json ├── commitlint-config-patternplate │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ ├── license.md │ └── package.json └── commitlint │ ├── CHANGELOG.md │ ├── README.md │ ├── cli.js │ ├── cli.test.js │ ├── fixtures │ └── default │ │ └── commitlint.config.js │ ├── license.md │ └── package.json ├── @commitlint ├── cli │ ├── CHANGELOG.md │ ├── README.md │ ├── cli.js │ ├── commitlint.config.js │ ├── fixtures │ │ ├── comment-char │ │ │ └── commitlint.config.js │ │ ├── custom-formatter │ │ │ ├── commitlint.config.js │ │ │ └── formatters │ │ │ │ └── custom.js │ │ ├── default-ignores-false │ │ │ └── commitlint.config.js │ │ ├── default-ignores-true │ │ │ └── commitlint.config.js │ │ ├── default-ignores-unset │ │ │ └── commitlint.config.js │ │ ├── default │ │ │ └── commitlint.config.js │ │ ├── empty │ │ │ └── commitlint.config.js │ │ ├── extends-root │ │ │ └── extended.js │ │ ├── help-url │ │ │ └── commitlint.config.js │ │ ├── husky │ │ │ ├── integration │ │ │ │ ├── commitlint.config.js │ │ │ │ └── package.json │ │ │ └── package.json │ │ ├── ignores │ │ │ └── commitlint.config.js │ │ ├── inner-scope │ │ │ ├── commitlint.config.js │ │ │ └── inner-scope │ │ │ │ └── commitlint.config.js │ │ ├── issue-prefixes │ │ │ └── commitlint.config.js │ │ ├── last-flag-regression │ │ │ └── commitlint.config.js │ │ ├── outer-scope │ │ │ └── commitlint.config.js │ │ ├── package.json │ │ ├── parser-preset │ │ │ ├── commitlint.config.js │ │ │ └── parser-preset.js │ │ ├── signoff │ │ │ ├── commitlint.config.js │ │ │ └── package.json │ │ ├── simple │ │ │ └── commitlint.config.js │ │ ├── specify-config-file │ │ │ ├── commitlint.config.js │ │ │ └── config │ │ │ │ └── commitlint.config.js │ │ └── warning │ │ │ └── commitlint.config.js │ ├── index.cjs │ ├── license.md │ ├── package.json │ ├── src │ │ ├── cli-error.ts │ │ ├── cli.test.ts │ │ ├── cli.ts │ │ └── types.ts │ └── tsconfig.json ├── config-angular-type-enum │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ ├── license.md │ └── package.json ├── config-angular │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ ├── index.test.js │ ├── license.md │ └── package.json ├── config-conventional │ ├── CHANGELOG.md │ ├── README.md │ ├── license.md │ ├── package.json │ ├── src │ │ ├── index.test.ts │ │ └── index.ts │ └── tsconfig.json ├── config-lerna-scopes │ ├── CHANGELOG.md │ ├── fixtures │ │ ├── basic │ │ │ ├── lerna.json │ │ │ ├── package.json │ │ │ └── packages │ │ │ │ ├── a │ │ │ │ └── package.json │ │ │ │ └── b │ │ │ │ └── package.json │ │ ├── empty │ │ │ ├── lerna.json │ │ │ └── package.json │ │ ├── modules │ │ │ ├── lerna.json │ │ │ ├── package.json │ │ │ └── packages │ │ │ │ ├── a │ │ │ │ └── package.json │ │ │ │ └── module │ │ │ │ └── package.json │ │ ├── nested │ │ │ ├── lerna.json │ │ │ ├── package.json │ │ │ └── packages │ │ │ │ ├── a │ │ │ │ └── nested-a │ │ │ │ │ └── package.json │ │ │ │ ├── b │ │ │ │ └── nested-b │ │ │ │ │ └── package.json │ │ │ │ └── c │ │ │ │ └── package.json │ │ ├── no-packages-declaration │ │ │ ├── lerna.json │ │ │ └── package.json │ │ ├── scoped │ │ │ ├── @packages │ │ │ │ ├── a │ │ │ │ │ └── package.json │ │ │ │ └── b │ │ │ │ │ └── package.json │ │ │ ├── lerna.json │ │ │ └── package.json │ │ └── transition-to-workspace-scopes │ │ │ ├── lerna.json │ │ │ ├── package.json │ │ │ └── packages │ │ │ └── workspace-package │ │ │ └── package.json │ ├── index.js │ ├── index.test.js │ ├── license.md │ ├── package.json │ └── readme.md ├── config-nx-scopes │ ├── CHANGELOG.md │ ├── fixtures │ │ ├── basic │ │ │ ├── nx.json │ │ │ ├── nx │ │ │ │ ├── a │ │ │ │ │ ├── package.json │ │ │ │ │ └── project.json │ │ │ │ └── b │ │ │ │ │ ├── package.json │ │ │ │ │ └── project.json │ │ │ └── package.json │ │ ├── empty │ │ │ ├── nx.json │ │ │ └── package.json │ │ ├── nx14 │ │ │ ├── nx.json │ │ │ ├── nx │ │ │ │ ├── c │ │ │ │ │ ├── package.json │ │ │ │ │ └── project.json │ │ │ │ └── d │ │ │ │ │ ├── package.json │ │ │ │ │ └── project.json │ │ │ ├── package.json │ │ │ └── workspace.json │ │ ├── nx15 │ │ │ ├── nx.json │ │ │ ├── nx │ │ │ │ ├── e │ │ │ │ │ ├── package.json │ │ │ │ │ └── project.json │ │ │ │ └── f │ │ │ │ │ ├── package.json │ │ │ │ │ └── project.json │ │ │ └── package.json │ │ └── nx17 │ │ │ ├── nx.json │ │ │ ├── nx │ │ │ ├── g │ │ │ │ ├── package.json │ │ │ │ └── project.json │ │ │ └── h │ │ │ │ ├── package.json │ │ │ │ └── project.json │ │ │ └── package.json │ ├── index.js │ ├── index.test.js │ ├── license.md │ ├── package.json │ └── readme.md ├── config-patternplate │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ ├── license.md │ └── package.json ├── config-pnpm-scopes │ ├── CHANGELOG.md │ ├── fixtures │ │ ├── basic │ │ │ ├── package.json │ │ │ ├── packages │ │ │ │ ├── a │ │ │ │ │ └── package.json │ │ │ │ └── b │ │ │ │ │ └── package.json │ │ │ └── pnpm-workspace.yaml │ │ ├── empty │ │ │ ├── package.json │ │ │ └── pnpm-workspace.yaml │ │ └── scoped │ │ │ ├── package.json │ │ │ ├── packages │ │ │ ├── a │ │ │ │ └── package.json │ │ │ └── b │ │ │ │ └── package.json │ │ │ └── pnpm-workspace.yaml │ ├── index.js │ ├── index.test.js │ ├── license.md │ ├── package.json │ └── readme.md ├── config-rush-scopes │ ├── CHANGELOG.md │ ├── fixtures │ │ ├── basic │ │ │ ├── packages │ │ │ │ ├── a │ │ │ │ │ └── package.json │ │ │ │ └── b │ │ │ │ │ └── package.json │ │ │ └── rush.json │ │ ├── empty │ │ │ └── rush.json │ │ └── scoped │ │ │ ├── @packages │ │ │ ├── a │ │ │ │ └── package.json │ │ │ └── b │ │ │ │ └── package.json │ │ │ └── rush.json │ ├── index.js │ ├── index.test.js │ ├── license.md │ ├── package.json │ └── readme.md ├── config-validator │ ├── CHANGELOG.md │ ├── package.json │ ├── src │ │ ├── __snapshots__ │ │ │ └── validate.test.ts.snap │ │ ├── commitlint.schema.json │ │ ├── formatErrors.ts │ │ ├── validate.test.ts │ │ └── validate.ts │ └── tsconfig.json ├── config-workspace-scopes │ ├── CHANGELOG.md │ ├── fixtures │ │ ├── basic │ │ │ ├── @packages │ │ │ │ ├── a │ │ │ │ │ └── package.json │ │ │ │ └── b │ │ │ │ │ └── package.json │ │ │ └── package.json │ │ ├── empty │ │ │ └── package.json │ │ ├── nested-workspaces │ │ │ ├── @packages │ │ │ │ ├── a │ │ │ │ │ └── nested-a │ │ │ │ │ │ └── package.json │ │ │ │ └── b │ │ │ │ │ └── nested-b │ │ │ │ │ └── package.json │ │ │ └── package.json │ │ └── scoped │ │ │ ├── @packages │ │ │ ├── a │ │ │ │ └── package.json │ │ │ └── b │ │ │ │ └── package.json │ │ │ ├── lerna.json │ │ │ └── package.json │ ├── index.js │ ├── index.test.js │ ├── license.md │ ├── package.json │ └── readme.md ├── core │ ├── CHANGELOG.md │ ├── README.md │ ├── license.md │ ├── package.json │ ├── src │ │ └── core.ts │ └── tsconfig.json ├── cz-commitlint │ ├── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── TODO │ ├── index.cjs │ ├── license.md │ ├── package.json │ ├── src │ │ ├── Process.test.ts │ │ ├── Process.ts │ │ ├── Question.test.ts │ │ ├── Question.ts │ │ ├── SectionBody.test.ts │ │ ├── SectionBody.ts │ │ ├── SectionFooter.test.ts │ │ ├── SectionFooter.ts │ │ ├── SectionHeader.test.ts │ │ ├── SectionHeader.ts │ │ ├── index.ts │ │ ├── services │ │ │ ├── getRuleQuestionConfig.test.ts │ │ │ └── getRuleQuestionConfig.ts │ │ ├── store │ │ │ ├── defaultPromptConfigs.ts │ │ │ ├── prompts.test.ts │ │ │ ├── prompts.ts │ │ │ ├── rules.test.ts │ │ │ └── rules.ts │ │ ├── types.ts │ │ └── utils │ │ │ ├── case-fn.test.ts │ │ │ ├── case-fn.ts │ │ │ ├── full-stop-fn.test.ts │ │ │ ├── full-stop-fn.ts │ │ │ ├── leading-blank-fn.test.ts │ │ │ ├── leading-blank-fn.ts │ │ │ ├── rules.test.ts │ │ │ └── rules.ts │ └── tsconfig.json ├── ensure │ ├── CHANGELOG.md │ ├── license.md │ ├── package.json │ ├── src │ │ ├── case.test.ts │ │ ├── case.ts │ │ ├── enum.test.ts │ │ ├── enum.ts │ │ ├── index.test.ts │ │ ├── index.ts │ │ ├── max-length.test.ts │ │ ├── max-length.ts │ │ ├── max-line-length.test.ts │ │ ├── max-line-length.ts │ │ ├── min-length.test.ts │ │ ├── min-length.ts │ │ ├── not-empty.test.ts │ │ ├── not-empty.ts │ │ └── to-case.ts │ └── tsconfig.json ├── execute-rule │ ├── CHANGELOG.md │ ├── license.md │ ├── package.json │ ├── src │ │ ├── index.test.ts │ │ └── index.ts │ └── tsconfig.json ├── format │ ├── CHANGELOG.md │ ├── README.md │ ├── license.md │ ├── package.json │ ├── src │ │ ├── format.test.ts │ │ ├── format.ts │ │ └── index.ts │ └── tsconfig.json ├── is-ignored │ ├── CHANGELOG.md │ ├── license.md │ ├── package.json │ ├── src │ │ ├── defaults.ts │ │ ├── index.ts │ │ ├── is-ignored.test.ts │ │ └── is-ignored.ts │ └── tsconfig.json ├── lint │ ├── CHANGELOG.md │ ├── README.md │ ├── license.md │ ├── package.json │ ├── src │ │ ├── commit-message.ts │ │ ├── lint.test.ts │ │ └── lint.ts │ └── tsconfig.json ├── load │ ├── CHANGELOG.md │ ├── README.md │ ├── fixtures │ │ ├── basic-config │ │ │ ├── .commitlintrc │ │ │ ├── .commitlintrc.cjs │ │ │ ├── .commitlintrc.js │ │ │ ├── .commitlintrc.json │ │ │ ├── .commitlintrc.yaml │ │ │ ├── .commitlintrc.yml │ │ │ ├── commitlint.config.cjs │ │ │ ├── commitlint.config.js │ │ │ └── esm │ │ │ │ ├── .commitlintrc.js │ │ │ │ ├── .commitlintrc.mjs │ │ │ │ ├── commitlint.config.js │ │ │ │ └── commitlint.config.mjs │ │ ├── basic-template │ │ │ └── package.json │ │ ├── basic │ │ │ └── commitlint.config.js │ │ ├── empty-file │ │ │ └── commitlint.config.js │ │ ├── empty-object-file │ │ │ └── commitlint.config.js │ │ ├── extends-config │ │ │ ├── .commitlintrc │ │ │ ├── .commitlintrc.cjs │ │ │ ├── .commitlintrc.js │ │ │ ├── .commitlintrc.json │ │ │ ├── .commitlintrc.yaml │ │ │ ├── .commitlintrc.yml │ │ │ ├── commitlint.config.cjs │ │ │ ├── commitlint.config.js │ │ │ └── esm │ │ │ │ ├── .commitlintrc.js │ │ │ │ ├── .commitlintrc.mjs │ │ │ │ ├── commitlint.config.js │ │ │ │ └── commitlint.config.mjs │ │ ├── extends-empty │ │ │ └── commitlint.config.js │ │ ├── extends-invalid │ │ │ └── commitlint.config.js │ │ ├── extends-js-template │ │ │ ├── first-extended │ │ │ │ ├── index.js │ │ │ │ └── second-extended │ │ │ │ │ └── index.js │ │ │ └── package.json │ │ ├── extends-plugins │ │ │ └── commitlint.config.js │ │ ├── extends-with-local-plugins │ │ │ ├── commitlint.config.js │ │ │ └── config-with-local-plugin │ │ │ │ ├── commitlint.config.js │ │ │ │ └── index.js │ │ ├── extends-with-plugins │ │ │ ├── commitlint.config.js │ │ │ └── config-with-plugins │ │ │ │ ├── commitlint.config.js │ │ │ │ └── index.js │ │ ├── formatter-local-module │ │ │ ├── commitlint.config.js │ │ │ └── formatters │ │ │ │ └── custom.js │ │ ├── formatter │ │ │ └── commitlint.config.js │ │ ├── help-url │ │ │ └── commitlint.config.js │ │ ├── outer-scope │ │ │ ├── commitlint.config.js │ │ │ └── inner-scope │ │ │ │ └── child-scope │ │ │ │ └── commitlint.config.js │ │ ├── overridden-type-enums │ │ │ ├── commitlint.config.js │ │ │ └── extended.js │ │ ├── package.json │ │ ├── parser-preset-angular │ │ │ ├── commitlint.config.js │ │ │ └── package.json │ │ ├── parser-preset-conventional-without-factory │ │ │ ├── commitlint.config.js │ │ │ └── package.json │ │ ├── parser-preset-conventionalcommits │ │ │ ├── commitlint.config.js │ │ │ └── package.json │ │ ├── parser-preset-override │ │ │ ├── commitlint.config.js │ │ │ ├── custom.js │ │ │ └── extended │ │ │ │ ├── custom.js │ │ │ │ └── index.js │ │ ├── parser-preset │ │ │ ├── commitlint.config.js │ │ │ └── conventional-changelog-custom.js │ │ ├── recursive-extends-ts │ │ │ ├── commitlint.config.ts │ │ │ ├── first-extended │ │ │ │ ├── index.ts │ │ │ │ └── second-extended │ │ │ │ │ └── index.ts │ │ │ └── types.ts │ │ ├── recursive-extends │ │ │ ├── commitlint.config.js │ │ │ └── first-extended │ │ │ │ ├── commitlint.config.js │ │ │ │ ├── index.js │ │ │ │ └── second-extended │ │ │ │ └── index.js │ │ ├── recursive-parser-preset-conventional-atom │ │ │ ├── commitlint.config.js │ │ │ └── first-extended │ │ │ │ ├── index.js │ │ │ │ └── second-extended │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ ├── recursive-parser-preset │ │ │ ├── commitlint.config.js │ │ │ └── first-extended │ │ │ │ ├── index.js │ │ │ │ └── second-extended │ │ │ │ ├── conventional-changelog-custom.js │ │ │ │ └── index.js │ │ ├── specify-config-file │ │ │ ├── commitlint.config.js │ │ │ └── config │ │ │ │ └── commitlint.config.js │ │ ├── trash-extend │ │ │ ├── commitlint.config.js │ │ │ └── one.js │ │ └── trash-file │ │ │ └── commitlint.config.js │ ├── license.md │ ├── package.json │ ├── src │ │ ├── load.test.ts │ │ ├── load.ts │ │ └── utils │ │ │ ├── load-config.ts │ │ │ ├── load-parser-opts.test.ts │ │ │ ├── load-parser-opts.ts │ │ │ ├── load-plugin.test.ts │ │ │ ├── load-plugin.ts │ │ │ ├── plugin-errors.ts │ │ │ └── plugin-naming.ts │ └── tsconfig.json ├── message │ ├── CHANGELOG.md │ ├── license.md │ ├── package.json │ ├── src │ │ ├── index.test.ts │ │ └── index.ts │ └── tsconfig.json ├── parse │ ├── CHANGELOG.md │ ├── README.md │ ├── license.md │ ├── package.json │ ├── src │ │ ├── index.test.ts │ │ └── index.ts │ └── tsconfig.json ├── prompt-cli │ ├── CHANGELOG.md │ ├── README.md │ ├── cli.js │ ├── cli.test.js │ ├── license.md │ └── package.json ├── prompt │ ├── CHANGELOG.md │ ├── README.md │ ├── license.md │ ├── package.json │ ├── src │ │ ├── index.ts │ │ ├── input.test.ts │ │ ├── input.ts │ │ ├── inquirer │ │ │ ├── InputCustomPrompt.ts │ │ │ └── inquirer.d.ts │ │ ├── library │ │ │ ├── format.test.ts │ │ │ ├── format.ts │ │ │ ├── get-forced-case-fn.test.ts │ │ │ ├── get-forced-case-fn.ts │ │ │ ├── get-forced-leading-fn.ts │ │ │ ├── get-prompt.ts │ │ │ ├── meta.ts │ │ │ ├── types.ts │ │ │ ├── utils.test.ts │ │ │ └── utils.ts │ │ └── settings.ts │ └── tsconfig.json ├── read │ ├── CHANGELOG.md │ ├── README.md │ ├── fixtures │ │ ├── basic │ │ │ └── commitlint.config.js │ │ ├── empty-file │ │ │ └── commitlint.config.js │ │ ├── empty-object-file │ │ │ └── commitlint.config.js │ │ ├── extends-empty │ │ │ └── commitlint.config.js │ │ ├── extends-invalid │ │ │ └── commitlint.config.js │ │ ├── outer-scope │ │ │ ├── commitlint.config.js │ │ │ └── inner-scope │ │ │ │ └── child-scope │ │ │ │ └── commitlint.config.js │ │ ├── overridden-type-enums │ │ │ ├── commitlint.config.js │ │ │ └── extended.js │ │ ├── package.json │ │ ├── parser-preset-override │ │ │ ├── commitlint.config.js │ │ │ ├── custom.js │ │ │ └── extended │ │ │ │ ├── custom.js │ │ │ │ └── index.js │ │ ├── parser-preset │ │ │ ├── commitlint.config.js │ │ │ └── conventional-changelog-custom.js │ │ ├── recursive-extends-js │ │ │ ├── .commitlintrc.js │ │ │ └── first-extended │ │ │ │ ├── index.js │ │ │ │ └── second-extended │ │ │ │ └── index.js │ │ ├── recursive-extends-json │ │ │ ├── .commitlintrc.json │ │ │ └── first-extended │ │ │ │ ├── index.js │ │ │ │ └── second-extended │ │ │ │ └── index.js │ │ ├── recursive-extends-package │ │ │ ├── first-extended │ │ │ │ ├── index.js │ │ │ │ └── second-extended │ │ │ │ │ └── index.js │ │ │ └── package.json │ │ ├── recursive-extends-yaml │ │ │ ├── .commitlintrc.yml │ │ │ └── first-extended │ │ │ │ ├── index.js │ │ │ │ └── second-extended │ │ │ │ └── index.js │ │ ├── recursive-extends │ │ │ ├── commitlint.config.js │ │ │ └── first-extended │ │ │ │ ├── commitlint.config.js │ │ │ │ ├── index.js │ │ │ │ └── second-extended │ │ │ │ └── index.js │ │ ├── recursive-parser-preset │ │ │ ├── commitlint.config.js │ │ │ └── first-extended │ │ │ │ ├── index.js │ │ │ │ └── second-extended │ │ │ │ ├── conventional-changelog-custom.js │ │ │ │ └── index.js │ │ ├── specify-config-file │ │ │ ├── commitlint.config.js │ │ │ └── config │ │ │ │ └── commitlint.config.js │ │ ├── trash-extend │ │ │ ├── commitlint.config.js │ │ │ └── one.js │ │ └── trash-file │ │ │ └── commitlint.config.js │ ├── license.md │ ├── package.json │ ├── src │ │ ├── get-edit-commit.ts │ │ ├── get-edit-file-path.ts │ │ ├── get-history-commits.ts │ │ ├── read.test.ts │ │ ├── read.ts │ │ └── stream-to-promise.ts │ └── tsconfig.json ├── resolve-extends │ ├── CHANGELOG.md │ ├── fixtures │ │ ├── global-install │ │ │ └── commitlint.config.js │ │ ├── missing-install │ │ │ └── commitlint.config.js │ │ └── package.json │ ├── license.md │ ├── package.json │ ├── src │ │ ├── index.test.ts │ │ └── index.ts │ └── tsconfig.json ├── rules │ ├── CHANGELOG.md │ ├── license.md │ ├── package.json │ ├── src │ │ ├── body-case.test.ts │ │ ├── body-case.ts │ │ ├── body-empty.test.ts │ │ ├── body-empty.ts │ │ ├── body-full-stop.test.ts │ │ ├── body-full-stop.ts │ │ ├── body-leading-blank.test.ts │ │ ├── body-leading-blank.ts │ │ ├── body-max-length.test.ts │ │ ├── body-max-length.ts │ │ ├── body-max-line-length.test.ts │ │ ├── body-max-line-length.ts │ │ ├── body-min-length.test.ts │ │ ├── body-min-length.ts │ │ ├── footer-empty.test.ts │ │ ├── footer-empty.ts │ │ ├── footer-leading-blank.test.ts │ │ ├── footer-leading-blank.ts │ │ ├── footer-max-length.test.ts │ │ ├── footer-max-length.ts │ │ ├── footer-max-line-length.test.ts │ │ ├── footer-max-line-length.ts │ │ ├── footer-min-length.test.ts │ │ ├── footer-min-length.ts │ │ ├── header-case.test.ts │ │ ├── header-case.ts │ │ ├── header-full-stop.test.ts │ │ ├── header-full-stop.ts │ │ ├── header-max-length.test.ts │ │ ├── header-max-length.ts │ │ ├── header-min-length.test.ts │ │ ├── header-min-length.ts │ │ ├── header-trim.test.ts │ │ ├── header-trim.ts │ │ ├── index.test.ts │ │ ├── index.ts │ │ ├── references-empty.test.ts │ │ ├── references-empty.ts │ │ ├── scope-case.test.ts │ │ ├── scope-case.ts │ │ ├── scope-empty.test.ts │ │ ├── scope-empty.ts │ │ ├── scope-enum.test.ts │ │ ├── scope-enum.ts │ │ ├── scope-max-length.test.ts │ │ ├── scope-max-length.ts │ │ ├── scope-min-length.test.ts │ │ ├── scope-min-length.ts │ │ ├── signed-off-by.test.ts │ │ ├── signed-off-by.ts │ │ ├── subject-case.test.ts │ │ ├── subject-case.ts │ │ ├── subject-empty.test.ts │ │ ├── subject-empty.ts │ │ ├── subject-exclamation-mark.test.ts │ │ ├── subject-exclamation-mark.ts │ │ ├── subject-full-stop.test.ts │ │ ├── subject-full-stop.ts │ │ ├── subject-max-length.test.ts │ │ ├── subject-max-length.ts │ │ ├── subject-min-length.test.ts │ │ ├── subject-min-length.ts │ │ ├── trailer-exists.test.ts │ │ ├── trailer-exists.ts │ │ ├── type-case.test.ts │ │ ├── type-case.ts │ │ ├── type-empty.test.ts │ │ ├── type-empty.ts │ │ ├── type-enum.test.ts │ │ ├── type-enum.ts │ │ ├── type-max-length.test.ts │ │ ├── type-max-length.ts │ │ ├── type-min-length.test.ts │ │ └── type-min-length.ts │ └── tsconfig.json ├── to-lines │ ├── CHANGELOG.md │ ├── license.md │ ├── package.json │ ├── src │ │ ├── index.test.ts │ │ └── index.ts │ └── tsconfig.json ├── top-level │ ├── CHANGELOG.md │ ├── license.md │ ├── package.json │ ├── src │ │ └── index.ts │ └── tsconfig.json ├── travis-cli │ ├── CHANGELOG.md │ ├── README.md │ ├── cli.js │ ├── fixtures │ │ ├── commitlint.js │ │ └── git.js │ ├── license.md │ ├── package.json │ ├── src │ │ ├── cli.test.ts │ │ └── cli.ts │ └── tsconfig.json └── types │ ├── CHANGELOG.md │ ├── package.json │ ├── src │ ├── ensure.ts │ ├── format.ts │ ├── index.ts │ ├── is-ignored.ts │ ├── lint.ts │ ├── load.ts │ ├── parse.ts │ ├── prompt.ts │ └── rules.ts │ └── tsconfig.json ├── @packages ├── test-environment │ ├── CHANGELOG.md │ ├── package.json │ ├── src │ │ └── test-environment.ts │ └── tsconfig.json ├── test │ ├── CHANGELOG.md │ ├── license.md │ ├── package.json │ ├── src │ │ ├── fix.ts │ │ ├── git.ts │ │ ├── index.test.ts │ │ ├── index.ts │ │ └── npm.ts │ └── tsconfig.json └── utils │ ├── CHANGELOG.md │ ├── dep-check.js │ ├── license.md │ ├── package.json │ └── pkg-check.js ├── CHANGELOG.md ├── Dockerfile.ci ├── Dockerfile.dev ├── README.md ├── docker-compose.yml ├── docs ├── .nojekyll ├── .vitepress │ ├── config.ts │ └── theme │ │ └── index.ts ├── CNAME ├── api │ ├── format.md │ ├── lint.md │ ├── load.md │ └── read.md ├── attributions.md ├── concepts │ ├── commit-conventions.md │ └── shareable-config.md ├── guides │ ├── ci-setup.md │ ├── getting-started.md │ ├── local-setup.md │ └── use-prompt.md ├── index.md ├── public │ └── assets │ │ ├── commitlint.json │ │ ├── commitlint.svg │ │ ├── cz-commitlint.png │ │ ├── icon.png │ │ └── icon.svg ├── reference │ ├── cli.md │ ├── community-projects.md │ ├── configuration.md │ ├── examples.md │ ├── plugins.md │ ├── prompt.md │ ├── rules-configuration.md │ └── rules.md └── support │ ├── releases.md │ ├── troubleshooting.md │ └── upgrade.md ├── eslint.config.mjs ├── lerna.json ├── license.md ├── package.json ├── tsconfig.json ├── tsconfig.shared.json ├── vitest.config.ts └── yarn.lock /.codesandbox/ci.json: -------------------------------------------------------------------------------- 1 | { 2 | "node": "18", 3 | "packages": ["@alias/*", "@commitlint/*"], 4 | "sandboxes": [] 5 | } 6 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "commitlint-dev", 3 | "dockerComposeFile": ["../docker-compose.yml"], 4 | "service": "commitlint", 5 | "workspaceFolder": "/root/repo", 6 | "shutdownAction": "stopCompose", 7 | "extensions": [ 8 | "editorconfig.editorconfig", 9 | "ms-vsliveshare.vsliveshare-pack", 10 | "ms-azuretools.vscode-docker", 11 | "esbenp.prettier-vscode" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | end_of_line = lf 3 | insert_final_newline = true 4 | trim_trailing_whitespace = true 5 | indent_style = tab 6 | 7 | [{.*rc,*.yml,*.md,*.json,*.svg}] 8 | indent_style = space 9 | 10 | [*.md] 11 | trim_trailing_whitespace = false 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .DS_Store 3 | *.log 4 | node_modules 5 | package-lock.json 6 | .npm 7 | .nyc_output 8 | .dockerignore 9 | .*.dockerfile 10 | lib/ 11 | package.json.lerna_backup 12 | /*.iml 13 | tsconfig.tsbuildinfo 14 | coverage 15 | 16 | docs/.vitepress/dist 17 | docs/.vitepress/cache 18 | 19 | # For testing nested workspaces does not have the package's dependencies name in the scope 20 | !**/config-lerna-scopes/fixtures/nested-workspaces/**/node_modules 21 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | node @commitlint/cli/lib/cli.js --edit $1 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | yarn lint-staged 2 | 3 | # be sure to build with up to date source 4 | # before running pre-commit hook which is using `@commitlint/cli/lib/cli.js` 5 | yarn build 6 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | legacy-peer-deps=true 2 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 18 -------------------------------------------------------------------------------- /.nxignore: -------------------------------------------------------------------------------- 1 | # Having fixtures with a package.json and project.json leads to a duplicate package resolution issue. 2 | # see https://github.com/nrwl/nx/issues/20959 3 | @commitlint/*/fixtures/** 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | coverage/ 3 | node_modules/ 4 | fixtures/ 5 | CHANGELOG.md 6 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | nodejs 18.20.8 2 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Jest Test Current file", 11 | "program": "${workspaceFolder}/node_modules/jest/bin/jest.js", 12 | "cwd": "${workspaceFolder}", 13 | "args": ["--runInBand", "--no-cache", "--no-coverage", "${fileBasename}"], 14 | "sourceMaps": true, 15 | "console": "integratedTerminal", 16 | "internalConsoleOptions": "neverOpen" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib" 3 | } 4 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | registry "https://registry.npmjs.org/" 2 | --install.ignore-engines true 3 | -------------------------------------------------------------------------------- /@alias/commitlint-config-angular/README.md: -------------------------------------------------------------------------------- 1 | # commitlint-config-angular 2 | 3 | > Alias of [@commitlint/config-angular](https://www.npmjs.com/package/@commitlint/config-angular) 4 | -------------------------------------------------------------------------------- /@alias/commitlint-config-angular/index.js: -------------------------------------------------------------------------------- 1 | export { default } from "@commitlint/config-angular"; 2 | -------------------------------------------------------------------------------- /@alias/commitlint-config-lerna-scopes/README.md: -------------------------------------------------------------------------------- 1 | # commitlint-config-lerna-scopes 2 | 3 | > Alias of [@commitlint/config-lerna-scopes](https://www.npmjs.com/package/@commitlint/config-lerna-scopes) 4 | -------------------------------------------------------------------------------- /@alias/commitlint-config-lerna-scopes/index.js: -------------------------------------------------------------------------------- 1 | export { default } from "@commitlint/config-lerna-scopes"; 2 | -------------------------------------------------------------------------------- /@alias/commitlint-config-nx-scopes/README.md: -------------------------------------------------------------------------------- 1 | # commitlint-config-nx-scopes 2 | 3 | > Alias of [@commitlint/config-nx-scopes](https://www.npmjs.com/package/@commitlint/config-nx-scopes) 4 | -------------------------------------------------------------------------------- /@alias/commitlint-config-nx-scopes/index.js: -------------------------------------------------------------------------------- 1 | export { default } from "@commitlint/config-nx-scopes"; 2 | -------------------------------------------------------------------------------- /@alias/commitlint-config-patternplate/README.md: -------------------------------------------------------------------------------- 1 | # commitlint-config-patternplate 2 | 3 | > Alias of [@commitlint/config-patternplate](https://www.npmjs.com/package/@commitlint/config-patternplate) 4 | -------------------------------------------------------------------------------- /@alias/commitlint-config-patternplate/index.js: -------------------------------------------------------------------------------- 1 | export { default } from "@commitlint/config-patternplate"; 2 | -------------------------------------------------------------------------------- /@alias/commitlint-config-patternplate/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "commitlint-config-patternplate", 3 | "type": "module", 4 | "version": "19.8.1", 5 | "description": "Lint your commits, patternplate-style", 6 | "files": [ 7 | "index.js" 8 | ], 9 | "scripts": { 10 | "deps": "dep-check", 11 | "pkg": "pkg-check" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/conventional-changelog/commitlint.git", 16 | "directory": "@alias/commitlint-config-patternplate" 17 | }, 18 | "keywords": [ 19 | "conventional-changelog", 20 | "commitlint", 21 | "commitlint-config", 22 | "angular" 23 | ], 24 | "author": "Mario Nebl ", 25 | "license": "MIT", 26 | "bugs": { 27 | "url": "https://github.com/conventional-changelog/commitlint/issues" 28 | }, 29 | "homepage": "https://commitlint.js.org/", 30 | "engines": { 31 | "node": ">=v18" 32 | }, 33 | "dependencies": { 34 | "@commitlint/config-patternplate": "^19.8.1" 35 | }, 36 | "devDependencies": { 37 | "@commitlint/utils": "^19.8.1" 38 | }, 39 | "gitHead": "e82f05a737626bb69979d14564f5ff601997f679" 40 | } 41 | -------------------------------------------------------------------------------- /@alias/commitlint/README.md: -------------------------------------------------------------------------------- 1 | # commitlint 2 | 3 | > Alias of [@commitlint/cli](https://www.npmjs.com/package/@commitlint/cli) 4 | -------------------------------------------------------------------------------- /@alias/commitlint/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import "@commitlint/cli/cli.js"; 3 | -------------------------------------------------------------------------------- /@alias/commitlint/fixtures/default/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'type-enum': [2, 'never', ['foo']] 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /@alias/commitlint/license.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 - present Mario Nebl 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /@commitlint/cli/README.md: -------------------------------------------------------------------------------- 1 | # @commitlint/cli 2 | 3 |

4 | 5 |

6 | 7 | Lint commit messages 8 | 9 | ## Documentation 10 | 11 | Consult [CLI reference](https://commitlint.js.org/reference/cli) for comprehensive documentation. 12 | -------------------------------------------------------------------------------- /@commitlint/cli/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import "./lib/cli.js"; 3 | -------------------------------------------------------------------------------- /@commitlint/cli/commitlint.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/conventional-changelog/commitlint/99bb0185abe627ae0b44028ca84935abfe2c239b/@commitlint/cli/commitlint.config.js -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/comment-char/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'body-empty': [2, 'never'] 4 | }, 5 | parserPreset: { 6 | parserOpts: { 7 | commentChar: '$' 8 | } 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/custom-formatter/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | formatter: 'custom-formatter', 3 | rules: { 4 | 'type-enum': [2, 'never', ['foo']] 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/custom-formatter/formatters/custom.js: -------------------------------------------------------------------------------- 1 | module.exports = function(_report) { 2 | return 'custom-formatter-ok'; 3 | }; 4 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/default-ignores-false/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | defaultIgnores: false, 3 | rules: { 4 | 'subject-empty': [2, 'never'] 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/default-ignores-true/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | defaultIgnores: true, 3 | rules: { 4 | 'subject-empty': [2, 'never'] 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/default-ignores-unset/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'subject-empty': [2, 'never'] 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/default/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'type-enum': [2, 'never', ['foo']] 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/empty/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/extends-root/extended.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'type-enum': [2, 'never', ['foo']] 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/help-url/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'type-enum': [2, 'never', ['foo']] 4 | }, 5 | helpUrl: 'https://www.example.com/foo' 6 | }; 7 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/husky/integration/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'type-enum': [2, 'never', ['foo']] 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/husky/integration/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": {}, 3 | "devDependencies": { 4 | "husky": "^5.1.1" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/husky/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": {}, 3 | "devDependencies": { 4 | "husky": "^5.1.1" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/ignores/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'type-enum': [2, 'always', ['type']], 4 | 'scope-enum': [2, 'always', ['scope']], 5 | 'subject-empty': [2, 'never'] 6 | }, 7 | ignores: [ 8 | commit => { 9 | return commit.includes('WIP'); 10 | } 11 | ] 12 | }; 13 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/inner-scope/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'type-enum': [2, 'always', ['outer']] 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/inner-scope/inner-scope/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'type-enum': [2, 'always', ['inner']] 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/issue-prefixes/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'references-empty': [2, 'never'] 4 | }, 5 | parserPreset: { 6 | parserOpts: { 7 | issuePrefixes: ['REF-'] 8 | } 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/last-flag-regression/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'subject-empty': [2, 'never'], 4 | 'type-empty': [2, 'never'], 5 | 'type-enum': [2, 'always', [ 6 | 'test' 7 | ]] 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/outer-scope/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'type-enum': [2, 'always', ['outer']] 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "commonjs" 3 | } 4 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/parser-preset/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parserPreset: './parser-preset', 3 | rules: { 4 | 'type-enum': [2, 'always', ['type']], 5 | 'scope-enum': [2, 'always', ['scope']], 6 | 'subject-empty': [2, 'never'] 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/parser-preset/parser-preset.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parserOpts: { 3 | headerPattern: /^----(\w*)\((\w*)\):\s(.*)$/, 4 | headerCorrespondence: ['type', 'scope', 'subject'] 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/signoff/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'signed-off-by': [2, 'always', 'Signed-off-by'] 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/signoff/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": {}, 3 | "devDependencies": { 4 | "husky": "^5.1.1" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/simple/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'type-enum': [2, 'never', ['foo']] 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/specify-config-file/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'header-max-length': [2, 'always', 4] 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/specify-config-file/config/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'type-enum': [2, 'never', ['foo']] 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /@commitlint/cli/fixtures/warning/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'type-enum': [2, 'always', ['feat']], 4 | 'subject-max-length': [1, 'always', 4] 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /@commitlint/cli/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('node:path'); 4 | 5 | module.exports = path.join(__dirname, 'cli.js'); 6 | -------------------------------------------------------------------------------- /@commitlint/cli/license.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 - present Mario Nebl 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /@commitlint/cli/src/cli-error.ts: -------------------------------------------------------------------------------- 1 | export enum ExitCode { 2 | CommitlintDefault = 0, 3 | CommitlintErrorDefault = 1, 4 | CommitLintWarning = 2, 5 | CommitLintError = 3, 6 | CommitlintInvalidArgument = 9, 7 | } 8 | 9 | export class CliError extends Error { 10 | __proto__ = Error; 11 | 12 | public type: string; 13 | public error_code: ExitCode; 14 | 15 | constructor( 16 | message: string, 17 | type: string, 18 | error_code = ExitCode.CommitlintErrorDefault, 19 | ) { 20 | super(message); 21 | 22 | this.type = type; 23 | this.error_code = error_code; 24 | 25 | Object.setPrototypeOf(this, CliError.prototype); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /@commitlint/cli/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface CliFlags { 2 | color: boolean; 3 | config?: string; 4 | cwd: string; 5 | edit?: string | boolean; 6 | env?: string; 7 | extends?: (string | number)[]; 8 | help?: boolean; 9 | "help-url"?: string; 10 | from?: string; 11 | "from-last-tag"?: boolean; 12 | "git-log-args"?: string; 13 | last?: boolean; 14 | format?: string; 15 | "parser-preset"?: string; 16 | quiet: boolean; 17 | to?: string; 18 | version?: boolean; 19 | verbose?: boolean; 20 | /** @type {'' | 'text' | 'json'} */ 21 | "print-config"?: string; 22 | strict?: boolean; 23 | _: (string | number)[]; 24 | $0: string; 25 | } 26 | -------------------------------------------------------------------------------- /@commitlint/cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.shared.json", 3 | "compilerOptions": { 4 | "composite": true, 5 | "rootDir": "./src", 6 | "outDir": "./lib" 7 | }, 8 | "include": ["./src/**/*.ts"], 9 | "exclude": ["./src/**/*.test.ts", "./lib/**/*"] 10 | } 11 | -------------------------------------------------------------------------------- /@commitlint/config-angular-type-enum/README.md: -------------------------------------------------------------------------------- 1 | # @commitlint/config-angular-type-enum 2 | 3 | Shareable `commitlint` config enforcing the angular commit convention types. 4 | Use with [@commitlint/cli](../cli) and [@commitlint/prompt-cli](../prompt-cli). 5 | 6 | See [@commitlint/config-angular](../config-angular) for full angular conventions. 7 | 8 | ## Getting started 9 | 10 | ```sh 11 | npm install --save-dev @commitlint/config-angular-type-enum @commitlint/cli 12 | echo "module.exports = {extends: ['@commitlint/config-angular-type-enum']};" > commitlint.config.js 13 | ``` 14 | 15 | ## Usage 16 | 17 | ```sh 18 | echo "foo: bar" | commitlint # fails 19 | echo "build: bar" | commitlint # passes 20 | ``` 21 | 22 | ## Examples 23 | 24 | ```js 25 | // commitlint.config.js 26 | const types = require("@commitlint/config-angular-type-enum"); 27 | 28 | // Use as rule creating errors for non-allowed types 29 | module.exports = { 30 | rules: { 31 | ...types.rules, 32 | }, 33 | }; 34 | 35 | // Warn for non-allowed types 36 | module.exports = { 37 | rules: { 38 | "type-enum": [1, "always", types.values()], 39 | }, 40 | }; 41 | ``` 42 | -------------------------------------------------------------------------------- /@commitlint/config-angular-type-enum/index.js: -------------------------------------------------------------------------------- 1 | const types = [ 2 | "build", 3 | "ci", 4 | "docs", 5 | "feat", 6 | "fix", 7 | "perf", 8 | "refactor", 9 | "revert", 10 | "style", 11 | "test", 12 | ]; 13 | 14 | export default { 15 | rules: { 16 | "type-enum": [2, "always", types], 17 | }, 18 | value: () => types, 19 | }; 20 | -------------------------------------------------------------------------------- /@commitlint/config-angular-type-enum/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@commitlint/config-angular-type-enum", 3 | "type": "module", 4 | "version": "19.8.1", 5 | "description": "Shareable commitlint config enforcing the angular commit convention types", 6 | "main": "index.js", 7 | "files": [ 8 | "index.js" 9 | ], 10 | "scripts": { 11 | "deps": "dep-check", 12 | "pkg": "pkg-check" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/conventional-changelog/commitlint.git", 17 | "directory": "@commitlint/config-angular-type-enum" 18 | }, 19 | "keywords": [ 20 | "conventional-changelog", 21 | "commitlint", 22 | "commitlint-config", 23 | "angular" 24 | ], 25 | "author": "Mario Nebl ", 26 | "license": "MIT", 27 | "bugs": { 28 | "url": "https://github.com/conventional-changelog/commitlint/issues" 29 | }, 30 | "homepage": "https://commitlint.js.org/", 31 | "engines": { 32 | "node": ">=v18" 33 | }, 34 | "devDependencies": { 35 | "@commitlint/utils": "^19.8.1" 36 | }, 37 | "gitHead": "e82f05a737626bb69979d14564f5ff601997f679" 38 | } 39 | -------------------------------------------------------------------------------- /@commitlint/config-angular/index.js: -------------------------------------------------------------------------------- 1 | import typeEnum from "@commitlint/config-angular-type-enum"; 2 | 3 | export default { 4 | parserPreset: { 5 | parserOpts: { headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/ }, 6 | }, 7 | rules: { 8 | "subject-exclamation-mark": [2, "never"], 9 | "body-leading-blank": [1, "always"], 10 | "footer-leading-blank": [1, "always"], 11 | "header-max-length": [2, "always", 72], 12 | "scope-case": [2, "always", "lower-case"], 13 | "subject-case": [ 14 | 2, 15 | "never", 16 | ["sentence-case", "start-case", "pascal-case", "upper-case"], 17 | ], 18 | "subject-empty": [2, "never"], 19 | "subject-full-stop": [2, "never", "."], 20 | "type-case": [2, "always", "lower-case"], 21 | "type-empty": [2, "never"], 22 | "type-enum": typeEnum.rules["type-enum"], 23 | }, 24 | }; 25 | -------------------------------------------------------------------------------- /@commitlint/config-conventional/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.shared.json", 3 | "compilerOptions": { 4 | "composite": true, 5 | "rootDir": "./src", 6 | "outDir": "./lib" 7 | }, 8 | "include": ["./src"], 9 | "exclude": ["./src/**/*.test.ts", "./lib/**/*"] 10 | } 11 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/basic/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "packages": ["packages/*"] 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/basic/packages/a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@commitlint-lerna-scopes/basic-a", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/basic/packages/b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@commitlint-lerna-scopes/basic-b", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/empty/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "packages": ["packages/*"] 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/empty/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "empty", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/modules/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "packages": ["packages/*"] 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/modules/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/modules/packages/a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@commitlint-lerna-scopes/modules-a", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/modules/packages/module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module" 3 | } 4 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/nested/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "packages": ["packages/**"] 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/nested/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nested-workspaces", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/nested/packages/a/nested-a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@commitlint-lerna-scopes/nested-a", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/nested/packages/b/nested-b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@commitlint-lerna-scopes/nested-b", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/nested/packages/c/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@commitlint-lerna-scopes/nested-c", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/no-packages-declaration/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0" 3 | } 4 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/no-packages-declaration/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@commitlint-lerna-scopes/no-packages-declaration", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/scoped/@packages/a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@commitlint-lerna-scopes/scoped-a", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/scoped/@packages/b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@commitlint-lerna-scopes/scoped-b", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/scoped/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "packages": ["@packages/**"] 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/scoped/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "scoped", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/transition-to-workspace-scopes/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0" 3 | } 4 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/transition-to-workspace-scopes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@commitlint-lerna-scopes/transition-to-workspace-scopes", 3 | "version": "1.0.0", 4 | "workspaces": ["./packages/*"] 5 | } 6 | -------------------------------------------------------------------------------- /@commitlint/config-lerna-scopes/fixtures/transition-to-workspace-scopes/packages/workspace-package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@commitlint-lerna-scopes/workspace-package", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/basic/nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmScope": "secretarium", 3 | "affected": { 4 | "defaultBase": "main" 5 | }, 6 | "cli": { 7 | "defaultCollection": "@nx/react" 8 | }, 9 | "tasksRunnerOptions": { 10 | "default": { 11 | "runner": "nx-cloud", 12 | "options": { 13 | "cacheableOperations": [ 14 | "build", 15 | "lint", 16 | "test", 17 | "e2e" 18 | ] 19 | } 20 | } 21 | }, 22 | "generators": { 23 | "@nx/react": { 24 | "application": { 25 | "style": "css", 26 | "linter": "eslint", 27 | "babel": true 28 | }, 29 | "component": { 30 | "style": "css" 31 | }, 32 | "library": { 33 | "style": "css", 34 | "linter": "eslint" 35 | } 36 | } 37 | }, 38 | "defaultProject": "a" 39 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/basic/nx/a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "a", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/basic/nx/a/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": "nx/a", 3 | "sourceRoot": "nx/a/src", 4 | "projectType": "library", 5 | "targets": { 6 | "lint": { 7 | "executor": "@nx/linter:eslint", 8 | "outputs": [ 9 | "{options.outputFile}" 10 | ], 11 | "options": { 12 | "lintFilePatterns": [ 13 | "nx/a/**/*.ts" 14 | ] 15 | } 16 | }, 17 | "test": { 18 | "executor": "@nx/jest:jest", 19 | "outputs": [ 20 | "coverage/nx/a" 21 | ], 22 | "options": { 23 | "jestConfig": "nx/a/jest.config.js", 24 | "passWithNoTests": true 25 | } 26 | } 27 | }, 28 | "tags": [] 29 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/basic/nx/b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "b", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/basic/nx/b/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": "nx/b", 3 | "sourceRoot": "nx/b/src", 4 | "projectType": "library", 5 | "targets": { 6 | "lint": { 7 | "executor": "@nx/linter:eslint", 8 | "outputs": [ 9 | "{options.outputFile}" 10 | ], 11 | "options": { 12 | "lintFilePatterns": [ 13 | "nx/b/**/*.ts" 14 | ] 15 | } 16 | }, 17 | "test": { 18 | "executor": "@nx/jest:jest", 19 | "outputs": [ 20 | "coverage/nx/b" 21 | ], 22 | "options": { 23 | "jestConfig": "nx/b/jest.config.js", 24 | "passWithNoTests": true 25 | } 26 | } 27 | }, 28 | "tags": [] 29 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "1.0.0", 4 | "devDependencies": { 5 | "nx": "^16.0.0" 6 | } 7 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/empty/nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmScope": "empty", 3 | "affected": { 4 | "defaultBase": "main" 5 | }, 6 | "implicitDependencies": { 7 | "package.json": { 8 | "dependencies": "*", 9 | "devDependencies": "*" 10 | }, 11 | ".eslintrc.json": "*" 12 | }, 13 | "tasksRunnerOptions": { 14 | "default": { 15 | "runner": "nx/tasks-runners/default", 16 | "options": { 17 | "cacheableOperations": [ 18 | "build", 19 | "lint", 20 | "test", 21 | "e2e" 22 | ] 23 | } 24 | } 25 | }, 26 | "targetDependencies": { 27 | "build": [ 28 | { 29 | "target": "build", 30 | "projects": "dependencies" 31 | } 32 | ] 33 | } 34 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/empty/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "empty", 3 | "version": "1.0.0", 4 | "devDependencies": { 5 | "nx": "^16.0.0" 6 | } 7 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx14/nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmScope": "secretarium", 3 | "affected": { 4 | "defaultBase": "main" 5 | }, 6 | "cli": { 7 | "defaultCollection": "@nrwl/react" 8 | }, 9 | "tasksRunnerOptions": { 10 | "default": { 11 | "runner": "@nrwl/nx-cloud", 12 | "options": { 13 | "cacheableOperations": [ 14 | "build", 15 | "lint", 16 | "test", 17 | "e2e" 18 | ] 19 | } 20 | } 21 | }, 22 | "generators": { 23 | "@nrwl/react": { 24 | "application": { 25 | "style": "css", 26 | "linter": "eslint", 27 | "babel": true 28 | }, 29 | "component": { 30 | "style": "css" 31 | }, 32 | "library": { 33 | "style": "css", 34 | "linter": "eslint" 35 | } 36 | } 37 | }, 38 | "defaultProject": "c" 39 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx14/nx/c/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "c", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx14/nx/c/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": "nx/c", 3 | "sourceRoot": "nx/c/src", 4 | "projectType": "library", 5 | "targets": { 6 | "lint": { 7 | "executor": "@nrwl/linter:eslint", 8 | "outputs": [ 9 | "{options.outputFile}" 10 | ], 11 | "options": { 12 | "lintFilePatterns": [ 13 | "nx/c/**/*.ts" 14 | ] 15 | } 16 | }, 17 | "test": { 18 | "executor": "@nrwl/jest:jest", 19 | "outputs": [ 20 | "coverage/nx/c" 21 | ], 22 | "options": { 23 | "jestConfig": "nx/c/jest.config.js", 24 | "passWithNoTests": true 25 | } 26 | } 27 | }, 28 | "tags": [] 29 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx14/nx/d/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "d", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx14/nx/d/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": "nx/d", 3 | "sourceRoot": "nx/d/src", 4 | "projectType": "library", 5 | "targets": { 6 | "lint": { 7 | "executor": "@nrwl/linter:eslint", 8 | "outputs": [ 9 | "{options.outputFile}" 10 | ], 11 | "options": { 12 | "lintFilePatterns": [ 13 | "nx/d/**/*.ts" 14 | ] 15 | } 16 | }, 17 | "test": { 18 | "executor": "@nrwl/jest:jest", 19 | "outputs": [ 20 | "coverage/nx/d" 21 | ], 22 | "options": { 23 | "jestConfig": "nx/d/jest.config.js", 24 | "passWithNoTests": true 25 | } 26 | } 27 | }, 28 | "tags": [] 29 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx14/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "1.0.0", 4 | "devDependencies": { 5 | "nx": "^14.0.0" 6 | } 7 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx14/workspace.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "projects": { 4 | "c": "nx/c", 5 | "d": "nx/d" 6 | } 7 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx15/nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmScope": "secretarium", 3 | "affected": { 4 | "defaultBase": "main" 5 | }, 6 | "cli": { 7 | "defaultCollection": "@nrwl/react" 8 | }, 9 | "tasksRunnerOptions": { 10 | "default": { 11 | "runner": "@nrwl/nx-cloud", 12 | "options": { 13 | "cacheableOperations": [ 14 | "build", 15 | "lint", 16 | "test", 17 | "e2e" 18 | ] 19 | } 20 | } 21 | }, 22 | "generators": { 23 | "@nrwl/react": { 24 | "application": { 25 | "style": "css", 26 | "linter": "eslint", 27 | "babel": true 28 | }, 29 | "component": { 30 | "style": "css" 31 | }, 32 | "library": { 33 | "style": "css", 34 | "linter": "eslint" 35 | } 36 | } 37 | }, 38 | "defaultProject": "e" 39 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx15/nx/e/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "e", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx15/nx/e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": "nx/e", 3 | "sourceRoot": "nx/e/src", 4 | "projectType": "library", 5 | "targets": { 6 | "lint": { 7 | "executor": "@nrwl/linter:eslint", 8 | "outputs": [ 9 | "{options.outputFile}" 10 | ], 11 | "options": { 12 | "lintFilePatterns": [ 13 | "nx/e/**/*.ts" 14 | ] 15 | } 16 | }, 17 | "test": { 18 | "executor": "@nrwl/jest:jest", 19 | "outputs": [ 20 | "coverage/nx/e" 21 | ], 22 | "options": { 23 | "jestConfig": "nx/e/jest.config.js", 24 | "passWithNoTests": true 25 | } 26 | } 27 | }, 28 | "tags": [] 29 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx15/nx/f/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "f", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx15/nx/f/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": "nx/f", 3 | "sourceRoot": "nx/f/src", 4 | "projectType": "library", 5 | "targets": { 6 | "lint": { 7 | "executor": "@nrwl/linter:eslint", 8 | "outputs": [ 9 | "{options.outputFile}" 10 | ], 11 | "options": { 12 | "lintFilePatterns": [ 13 | "nx/f/**/*.ts" 14 | ] 15 | } 16 | }, 17 | "test": { 18 | "executor": "@nrwl/jest:jest", 19 | "outputs": [ 20 | "coverage/nx/f" 21 | ], 22 | "options": { 23 | "jestConfig": "nx/f/jest.config.js", 24 | "passWithNoTests": true 25 | } 26 | } 27 | }, 28 | "tags": [] 29 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx15/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "1.0.0", 4 | "devDependencies": { 5 | "nx": "^15.0.0" 6 | } 7 | } -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx17/nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "affected": { 3 | "defaultBase": "main" 4 | }, 5 | "cli": { 6 | "defaultCollection": "@nx/react" 7 | }, 8 | "tasksRunnerOptions": { 9 | "default": { 10 | "runner": "nx-cloud", 11 | "options": { 12 | "cacheableOperations": [ 13 | "build", 14 | "lint", 15 | "test", 16 | "e2e" 17 | ] 18 | } 19 | } 20 | }, 21 | "generators": { 22 | "@nx/react": { 23 | "application": { 24 | "style": "css", 25 | "linter": "eslint", 26 | "babel": true 27 | }, 28 | "component": { 29 | "style": "css" 30 | }, 31 | "library": { 32 | "style": "css", 33 | "linter": "eslint" 34 | } 35 | } 36 | }, 37 | "defaultProject": "g" 38 | } 39 | -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx17/nx/g/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "g", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx17/nx/g/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": "nx/g", 3 | "sourceRoot": "nx/g/src", 4 | "projectType": "library", 5 | "targets": { 6 | "lint": { 7 | "executor": "@nx/linter:eslint", 8 | "outputs": [ 9 | "{options.outputFile}" 10 | ], 11 | "options": { 12 | "lintFilePatterns": [ 13 | "nx/g/**/*.ts" 14 | ] 15 | } 16 | }, 17 | "test": { 18 | "executor": "@nx/jest:jest", 19 | "outputs": [ 20 | "coverage/nx/g" 21 | ], 22 | "options": { 23 | "jestConfig": "nx/g/jest.config.js", 24 | "passWithNoTests": true 25 | } 26 | } 27 | }, 28 | "tags": [] 29 | } 30 | -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx17/nx/h/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "h", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx17/nx/h/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": "nx/h", 3 | "sourceRoot": "nx/h/src", 4 | "projectType": "library", 5 | "targets": { 6 | "lint": { 7 | "executor": "@nx/linter:eslint", 8 | "outputs": [ 9 | "{options.outputFile}" 10 | ], 11 | "options": { 12 | "lintFilePatterns": [ 13 | "nx/h/**/*.ts" 14 | ] 15 | } 16 | }, 17 | "test": { 18 | "executor": "@nx/jest:jest", 19 | "outputs": [ 20 | "coverage/nx/h" 21 | ], 22 | "options": { 23 | "jestConfig": "nx/h/jest.config.js", 24 | "passWithNoTests": true 25 | } 26 | } 27 | }, 28 | "tags": [] 29 | } 30 | -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/fixtures/nx17/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "1.0.0", 4 | "devDependencies": { 5 | "nx": "^17.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /@commitlint/config-nx-scopes/index.js: -------------------------------------------------------------------------------- 1 | import { RuleConfigSeverity } from "@commitlint/types"; 2 | import { getProjects as getNXProjects } from "nx/src/generators/utils/project-configuration.js"; 3 | import { FsTree } from "nx/src/generators/tree.js"; 4 | 5 | export default { 6 | utils: { getProjects }, 7 | rules: { 8 | "scope-enum": (ctx) => 9 | Promise.resolve([RuleConfigSeverity.Error, "always", getProjects(ctx)]), 10 | }, 11 | }; 12 | 13 | /** 14 | * @param {(params: Pick) => boolean} selector 15 | */ 16 | function getProjects(context, selector = () => true) { 17 | const ctx = context || {}; 18 | const cwd = ctx.cwd || process.cwd(); 19 | 20 | const projects = getNXProjects(new FsTree(cwd, false)); 21 | return Array.from(projects.entries()) 22 | .map(([name, project]) => ({ 23 | name, 24 | ...project, 25 | })) 26 | .filter((project) => 27 | selector({ 28 | name: project.name, 29 | projectType: project.projectType, 30 | tags: project.tags, 31 | }), 32 | ) 33 | .map((project) => project.name) 34 | .map((name) => (name.charAt(0) === "@" ? name.split("/")[1] : name)); 35 | } 36 | -------------------------------------------------------------------------------- /@commitlint/config-patternplate/README.md: -------------------------------------------------------------------------------- 1 | # @commitlint/config-patternplate 2 | 3 | Lint your commits, patternplate-style 4 | 5 | Shareable `commitlint` config enforcing the patternplate commit convention. 6 | Use with [@commitlint/cli](../cli) and [@commitlint/prompt-cli](../prompt-cli). 7 | 8 | ## Getting started 9 | 10 | ```sh 11 | npm install --save-dev @commitlint/config-patternplate @commitlint/cli 12 | echo "module.exports = {extends: ['@commitlint/config-patternplate']};" > commitlint.config.js 13 | ``` 14 | 15 | ## Rules 16 | 17 | `@commitlint/config-patternplate` extends the [shareable angular config](../config-angular#rules). 18 | Additionally these rules apply: 19 | 20 | ### Problems 21 | 22 | The following rules are considered problems for `@commitlint/config-patternplate` and will yield a non-zero exit code when not met. 23 | 24 | #### scope-enum 25 | 26 | - **description**: `scope` is found in `value` 27 | - **rule**: `always` 28 | - **value**: determined based on pattern tree. `system` and all pattern ids present in `patterns` are allowed 29 | 30 | Consult [Rules reference](https://commitlint.js.org/reference/rules) for a list of available rules. 31 | -------------------------------------------------------------------------------- /@commitlint/config-patternplate/index.js: -------------------------------------------------------------------------------- 1 | import path from "node:path"; 2 | 3 | import configAngular from "@commitlint/config-angular"; 4 | import { glob } from "glob"; 5 | import merge from "lodash.merge"; 6 | 7 | function pathToId(root, filePath) { 8 | const relativePath = path.relative(root, filePath); 9 | return path.dirname(relativePath).split(path.sep).join("/"); 10 | } 11 | 12 | async function getPatternIDs() { 13 | const root = path.resolve(process.cwd(), "./patterns"); 14 | const pattern = path.resolve(root, "**/pattern.json"); 15 | const files = glob(pattern); 16 | return files.map((result) => pathToId(root, result)); 17 | } 18 | 19 | export default merge(configAngular, { 20 | rules: { 21 | "scope-enum": () => 22 | getPatternIDs().then((ids) => [2, "always", ids.concat(["system"])]), 23 | }, 24 | }); 25 | -------------------------------------------------------------------------------- /@commitlint/config-pnpm-scopes/fixtures/basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "1.0.0", 4 | "private": true, 5 | "devDependencies": {} 6 | } 7 | -------------------------------------------------------------------------------- /@commitlint/config-pnpm-scopes/fixtures/basic/packages/a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "a", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-pnpm-scopes/fixtures/basic/packages/b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "b", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-pnpm-scopes/fixtures/basic/pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'packages/*' 3 | -------------------------------------------------------------------------------- /@commitlint/config-pnpm-scopes/fixtures/empty/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "empty", 3 | "version": "1.0.0", 4 | "private": true, 5 | "devDependencies": {} 6 | } 7 | -------------------------------------------------------------------------------- /@commitlint/config-pnpm-scopes/fixtures/empty/pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'packages/*' 3 | -------------------------------------------------------------------------------- /@commitlint/config-pnpm-scopes/fixtures/scoped/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "1.0.0", 4 | "private": true, 5 | "devDependencies": {} 6 | } 7 | -------------------------------------------------------------------------------- /@commitlint/config-pnpm-scopes/fixtures/scoped/packages/a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@scope/a", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-pnpm-scopes/fixtures/scoped/packages/b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@scope/b", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-pnpm-scopes/fixtures/scoped/pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'packages/*' 3 | -------------------------------------------------------------------------------- /@commitlint/config-rush-scopes/fixtures/basic/packages/a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "a", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-rush-scopes/fixtures/basic/packages/b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "b", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-rush-scopes/fixtures/scoped/@packages/a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@packages/a", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-rush-scopes/fixtures/scoped/@packages/b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@packages/b", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-rush-scopes/index.js: -------------------------------------------------------------------------------- 1 | import Path from "node:path"; 2 | import fs from "fs/promises"; 3 | 4 | import jsonc from "jsonc"; 5 | 6 | export default { 7 | utils: { getPackages }, 8 | rules: { 9 | "scope-enum": (ctx) => 10 | getPackages(ctx).then((packages) => [2, "always", packages]), 11 | }, 12 | }; 13 | 14 | function getPackages(context) { 15 | return Promise.resolve() 16 | .then(() => { 17 | const ctx = context || {}; 18 | const cwd = ctx.cwd || process.cwd(); 19 | 20 | return fs 21 | .readFile(Path.join(cwd, "rush.json"), { encoding: "utf8" }) 22 | .then((content) => jsonc.parse(content)) 23 | .then(({ projects }) => projects) 24 | .catch(() => []); 25 | }) 26 | .then((packages) => { 27 | return packages 28 | .map((pkg) => pkg.packageName) 29 | .filter(Boolean) 30 | .map((name) => (name.charAt(0) === "@" ? name.split("/")[1] : name)); 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /@commitlint/config-validator/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.shared.json", 3 | "compilerOptions": { 4 | "composite": true, 5 | "rootDir": "./src", 6 | "outDir": "./lib" 7 | }, 8 | "include": ["./src/**/*.ts", "./src/**/*.json"], 9 | "exclude": ["./src/**/*.test.ts", "./lib/**/*"], 10 | "references": [{ "path": "../types" }] 11 | } 12 | -------------------------------------------------------------------------------- /@commitlint/config-workspace-scopes/fixtures/basic/@packages/a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@packages/a", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-workspace-scopes/fixtures/basic/@packages/b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@packages/b", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-workspace-scopes/fixtures/basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yarn", 3 | "version": "1.0.0", 4 | "workspaces": [ 5 | "@packages/*" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /@commitlint/config-workspace-scopes/fixtures/empty/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "empty", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-workspace-scopes/fixtures/nested-workspaces/@packages/a/nested-a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@packages/nested-a", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-workspace-scopes/fixtures/nested-workspaces/@packages/b/nested-b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@packages/nested-b", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-workspace-scopes/fixtures/nested-workspaces/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nested-workspaces", 3 | "version": "1.0.0", 4 | "workspaces": [ 5 | "@packages/**" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /@commitlint/config-workspace-scopes/fixtures/scoped/@packages/a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@packages/a", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-workspace-scopes/fixtures/scoped/@packages/b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@packages/b", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /@commitlint/config-workspace-scopes/fixtures/scoped/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "lerna": "4", 3 | "version": "1.0.0", 4 | "packages": ["@packages/*"] 5 | } 6 | -------------------------------------------------------------------------------- /@commitlint/config-workspace-scopes/fixtures/scoped/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "scoped", 3 | "version": "1.0.0", 4 | "workspaces": [ 5 | "@packages/**" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /@commitlint/core/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/conventional-changelog/commitlint/99bb0185abe627ae0b44028ca84935abfe2c239b/@commitlint/core/README.md -------------------------------------------------------------------------------- /@commitlint/core/license.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 - present Mario Nebl 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /@commitlint/core/src/core.ts: -------------------------------------------------------------------------------- 1 | import format from "@commitlint/format"; 2 | import load from "@commitlint/load"; 3 | import lint from "@commitlint/lint"; 4 | import read from "@commitlint/read"; 5 | 6 | export { format, load, lint, read }; 7 | -------------------------------------------------------------------------------- /@commitlint/core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.shared.json", 3 | "compilerOptions": { 4 | "composite": true, 5 | "rootDir": "./src", 6 | "outDir": "./lib" 7 | }, 8 | "include": ["./src/**/*.ts"], 9 | "exclude": ["./src/**/*.test.ts", "./lib/**/*"] 10 | } 11 | -------------------------------------------------------------------------------- /@commitlint/cz-commitlint/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | -------------------------------------------------------------------------------- /@commitlint/cz-commitlint/TODO: -------------------------------------------------------------------------------- 1 | [x] jest Test 2 | [x] insert prompt settings to commitlint.config.js 3 | [] support multi line 4 | [] support emoji and title 5 | [] recognize "signed-off-by" and "references-empty" rules 6 | -------------------------------------------------------------------------------- /@commitlint/cz-commitlint/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** @type {Awaited['prompter']} */ 4 | exports.prompter = async (...args) => { 5 | (await import('./lib/index.js')).prompter(...args); 6 | }; 7 | -------------------------------------------------------------------------------- /@commitlint/cz-commitlint/license.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /@commitlint/cz-commitlint/src/index.ts: -------------------------------------------------------------------------------- 1 | import load from "@commitlint/load"; 2 | import type { Answers, DistinctQuestion } from "inquirer"; 3 | 4 | import process from "./Process.js"; 5 | 6 | type Commit = (message: string) => void; 7 | /** 8 | * Entry point for commitizen 9 | * @param inquirerIns instance passed by commitizen, unused 10 | * @param commit callback to execute with complete commit message 11 | * @return {void} 12 | */ 13 | export function prompter( 14 | inquirerIns: { 15 | prompt(questions: DistinctQuestion[]): Promise; 16 | }, 17 | commit: Commit, 18 | ): void { 19 | load().then(({ rules, prompt = {} }) => { 20 | process(rules, prompt, inquirerIns).then(commit); 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /@commitlint/cz-commitlint/src/store/defaultPromptConfigs.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | settings: { 3 | scopeEnumSeparator: ",", 4 | enableMultipleScopes: false, 5 | }, 6 | messages: { 7 | skip: "(press enter to skip)", 8 | max: "(max %d chars)", 9 | min: "(min %d chars)", 10 | emptyWarning: "(%s is required)", 11 | upperLimitWarning: "%s is %d characters longer than the upper limit", 12 | lowerLimitWarning: "%s is %d characters less than the lower limit", 13 | }, 14 | questions: { 15 | type: { 16 | description: " holds information about the goal of a change.", 17 | }, 18 | scope: { 19 | description: 20 | " marks which sub-component of the project is affected", 21 | }, 22 | subject: { 23 | description: " is a short, high-level description of the change", 24 | }, 25 | body: { 26 | description: " holds additional information about the change", 27 | }, 28 | footer: { 29 | description: 30 | "