Skip to content

Commit

Permalink
fix: ensure format() is available as commonjs default export #645
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed May 9, 2019
1 parent 12e97e2 commit ec3da92
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions @commitlint/format/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import chalk from 'chalk';
const DEFAULT_SIGNS = [' ', '⚠', '✖'];
const DEFAULT_COLORS = ['white', 'yellow', 'red'];

export default function format(report = {}, options = {}) {
module.exports = format;
module.exports.default = format;
module.exports.format = format;
module.exports.formatResult = formatResult;

function format(report = {}, options = {}) {
const {results = []} = report;

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

export function formatResult(result = {}, options = {}) {
function formatResult(result = {}, options = {}) {
const {
signs = DEFAULT_SIGNS,
colors = DEFAULT_COLORS,
Expand Down

0 comments on commit ec3da92

Please sign in to comment.