bugfix: set color level when color is forced (#7216)

Color level 1 matches our usages, level 0 is no color
This commit is contained in:
Joe Haddad 2018-01-14 13:43:20 -05:00 committed by Brian Ng
parent 2d05487293
commit ca86648726

View File

@ -190,7 +190,7 @@ export function codeFrameColumns(
(opts.highlightCode && Chalk.supportsColor) || opts.forceColor; (opts.highlightCode && Chalk.supportsColor) || opts.forceColor;
let chalk = Chalk; let chalk = Chalk;
if (opts.forceColor) { if (opts.forceColor) {
chalk = new Chalk.constructor({ enabled: true }); chalk = new Chalk.constructor({ enabled: true, level: 1 });
} }
const maybeHighlight = (chalkFn, string) => { const maybeHighlight = (chalkFn, string) => {
return highlighted ? chalkFn(string) : string; return highlighted ? chalkFn(string) : string;