Skip to content

Commit aeb12b5

Browse files
authored
Merge pull request #140 from CrowdStrike/renovate/major-commitlint-monorepo
fix(deps): update commitlint monorepo to v19 (major)
2 parents 017c668 + 360064f commit aeb12b5

File tree

4 files changed

+282
-190
lines changed

4 files changed

+282
-190
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
"node": ">=18.12"
4242
},
4343
"dependencies": {
44-
"@commitlint/config-conventional": "^18.0.0",
45-
"@commitlint/format": "^18.0.0",
46-
"@commitlint/lint": "^18.0.0",
47-
"@commitlint/load": "^18.0.0",
48-
"@commitlint/read": "^18.0.0",
44+
"@commitlint/config-conventional": "^19.0.0",
45+
"@commitlint/format": "^19.0.0",
46+
"@commitlint/lint": "^19.0.0",
47+
"@commitlint/load": "^19.0.0",
48+
"@commitlint/read": "^19.0.0",
4949
"commitlint-format-junit": "^1.1.4",
5050
"debug": "^4.1.1",
5151
"execa": "^9.0.0",

src/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
'use strict';
22

3-
const load = require('@commitlint/load').default;
4-
const read = require('@commitlint/read').default;
5-
const lint = require('@commitlint/lint').default;
6-
const { format } = require('@commitlint/format');
73
const formatJunit = require('commitlint-format-junit');
84
const {
95
getCurrentBranch,
@@ -23,6 +19,10 @@ function doesReportMatchErrorSchema(report, schema) {
2319
}
2420

2521
async function runCommitLint(commit) {
22+
const { default: load } = await import('@commitlint/load');
23+
const { default: read } = await import('@commitlint/read');
24+
const { default: lint } = await import('@commitlint/lint');
25+
2626
let { rules, parserPreset } = await load();
2727

2828
let opts = parserPreset ? { parserOpts: parserPreset.parserOpts } : {};
@@ -64,15 +64,17 @@ async function runCommitLint(commit) {
6464
process.exitCode = 1;
6565
}
6666

67-
return _format({
67+
return await _format({
6868
valid: !didFailLinting,
6969
errorCount,
7070
warningCount: 0,
7171
results: reports,
7272
});
7373
}
7474

75-
function _format(payload) {
75+
async function _format(payload) {
76+
const { default: format } = await import('@commitlint/format');
77+
7678
let _format;
7779
if (process.env.COMMITLINT_REPORTER === 'junit') {
7880
_format = formatJunit;

test/index-test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ describe(function() {
105105
let { stdout } = await execa(bin, { cwd: tmpPath });
106106

107107
expect(stdout).to.equal(`⧗ input: CHORE: foo
108+
108109
✔ found 0 problems, 0 warnings`);
109110
});
110111
});
@@ -140,6 +141,7 @@ describe(function() {
140141
let { stdout } = await execa(bin, ['--default-branch', 'foo'], { cwd: tmpPath });
141142

142143
expect(stdout).to.equal(`⧗ input: CHORE: foo
144+
143145
✔ found 0 problems, 0 warnings`);
144146
});
145147
});

0 commit comments

Comments
 (0)