Skip to content

Commit ec3da92

Browse files
committed
fix: ensure format() is available as commonjs default export #645
1 parent 12e97e2 commit ec3da92

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: @commitlint/format/src/index.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import chalk from 'chalk';
33
const DEFAULT_SIGNS = [' ', '⚠', '✖'];
44
const DEFAULT_COLORS = ['white', 'yellow', 'red'];
55

6-
export default function format(report = {}, options = {}) {
6+
module.exports = format;
7+
module.exports.default = format;
8+
module.exports.format = format;
9+
module.exports.formatResult = formatResult;
10+
11+
function format(report = {}, options = {}) {
712
const {results = []} = report;
813

914
if (results.length > 0) {
@@ -38,7 +43,7 @@ function formatInput(result = {}, options = {}) {
3843
return `\n${decoration} input: ${decoratedInput}\n`;
3944
}
4045

41-
export function formatResult(result = {}, options = {}) {
46+
function formatResult(result = {}, options = {}) {
4247
const {
4348
signs = DEFAULT_SIGNS,
4449
colors = DEFAULT_COLORS,

0 commit comments

Comments
 (0)