commitlint-config-ghostwriter
Version:
A configurable commitlint preset
26 lines (25 loc) • 1.2 kB
JavaScript
;
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
const configuration_1 = require("./configuration");
const config = (0, configuration_1.getConfiguration)();
const hasScopes = Boolean((_a = config.scopes) === null || _a === void 0 ? void 0 : _a.length);
const maxLineLength = 120;
module.exports = {
parserPreset: 'conventional-changelog-ghostwriter',
rules: {
'body-leading-blank': [1, 'always'],
'body-max-line-length': [2, 'always', maxLineLength],
'footer-leading-blank': [1, 'always'],
'footer-max-line-length': [2, 'always', maxLineLength],
'header-max-length': [2, 'always', maxLineLength],
'scope-enum': [hasScopes ? 2 : 0, 'always', config.scopes.map(({ type }) => type)],
'scope-case': [hasScopes ? 0 : 2, 'always', 'kebab-case'],
'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', config.types.map(({ type }) => type)],
},
};