1 | "use strict";
|
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
4 | };
|
5 | Object.defineProperty(exports, "__esModule", { value: true });
|
6 | exports.bodyLeadingBlank = void 0;
|
7 | const to_lines_1 = __importDefault(require("@commitlint/to-lines"));
|
8 | const message_1 = __importDefault(require("@commitlint/message"));
|
9 | const bodyLeadingBlank = (parsed, when) => {
|
10 |
|
11 | if (!parsed.body) {
|
12 | return [true];
|
13 | }
|
14 | const negated = when === 'never';
|
15 | const [leading] = to_lines_1.default(parsed.raw).slice(1);
|
16 |
|
17 | const succeeds = leading === '';
|
18 | return [
|
19 | negated ? !succeeds : succeeds,
|
20 | message_1.default(['body', negated ? 'may not' : 'must', 'have leading blank line']),
|
21 | ];
|
22 | };
|
23 | exports.bodyLeadingBlank = bodyLeadingBlank;
|
24 |
|
\ | No newline at end of file |