UNPKG

@vortex.so/changelog-lint

Version:

Changelog lint of Vortex.

82 lines (79 loc) 2.5 kB
import { TYPES } from '@vortex.so/changelog-types'; import { getScopes } from './scopes.mjs'; /** * @copyright 2022, Bian Pratama * @license https://opensource.org/licenses/MIT */ const index = { // extends: ['@commitlint/config-conventional'], parserPreset: "conventional-changelog-conventionalcommits", rules: { "body-leading-blank": [1, "always"], // 'body-max-line-length': [2, 'always', 100], "body-max-line-length": [0], "footer-leading-blank": [1, "always"], // 'footer-max-line-length': [2, 'always', 100], "footer-max-line-length": [0], // 'header-max-length': [2, 'always', 100], "header-max-length": [0], "subject-case": [ 2, "never", ["sentence-case", "start-case", "pascal-case", "upper-case"] ], "subject-empty": [2, "never"], "subject-full-stop": [2, "never", "."], "type-case": [2, "always", "lower-case"], "type-empty": [2, "never"], "type-enum": [2, "always", TYPES.map((t) => t.handle)], "scope-enum": [2, "always", getScopes()], "scope-empty": [2, "never"] }, prompt: { settings: { enableMultipleScopes: true, scopeEnumSeparator: "," }, questions: { type: { description: "Select the type of change that you're committing", enum: TYPES.reduce((e, t) => { e[t.handle] = { description: [t.emoji, t.description].join(" "), title: t.title, emoji: t.emoji }; return e; }, {}) }, scope: { description: "What is the scope of this change (e.g. component or package)" }, subject: { description: "Write a short, imperative tense description of the change" }, body: { description: "Provide a longer description of the change" } }, isBreaking: { description: "Are there any breaking changes?" }, breakingBody: { description: "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself" }, breaking: { description: "Describe the breaking changes" }, isIssueAffected: { description: "Does this change affect any open issues?" }, issuesBody: { description: "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself" }, issues: { description: 'Add issue references (e.g. "fix #123", "re #123".)' } } }; export { index as default };