Skip to content

Commit 8862788

Browse files
byCedricmarionebl
authored andcommitted
refactor(format): remove flags and replace with plain options
1 parent c964696 commit 8862788

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

@commitlint/format/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
"concurrently": "3.5.1",
6969
"cross-env": "5.1.1",
7070
"lodash.includes": "4.3.0",
71-
"lodash.merge": "4.3.0",
7271
"rimraf": "2.6.1",
7372
"xo": "0.20.3"
7473
},

@commitlint/format/src/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
import chalk from 'chalk';
2-
import merge from 'lodash.merge';
32

43
const DEFAULT_SIGNS = [' ', '⚠', '✖'];
54
const DEFAULT_COLORS = ['white', 'yellow', 'red'];
65

7-
export default function format(report = {}, flags = {}, options = {}) {
8-
const opts = merge({color: flags.color}, options);
6+
export default function format(report = {}, options = {}) {
97
const {results = []} = report;
108

119
if (results.length > 0) {
1210
return results
1311
.map(
1412
result =>
15-
`${formatInput(result, opts)}${formatResult(result, opts).join('\n')}`
13+
`${formatInput(result, options)}${formatResult(result, options).join(
14+
'\n'
15+
)}`
1616
)
1717
.join('\n');
1818
}
1919

2020
// Output a summary when nothing is found
21-
return formatResult({}, opts).join('\n');
21+
return formatResult({}, options).join('\n');
2222
}
2323

2424
function formatInput(result = {}, options = {}) {

@commitlint/format/src/index.test.js

-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ test('uses signs as configured', t => {
117117
}
118118
]
119119
},
120-
{},
121120
options
122121
);
123122

@@ -135,7 +134,6 @@ test('uses signs as configured', t => {
135134
}
136135
]
137136
},
138-
{},
139137
options
140138
);
141139

0 commit comments

Comments
 (0)