Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
"webpack": "^4.47.0"
},
"dependencies": {
"chalk": "^2.4.2",
"consola": "^3.2.3",
"error-stack-parser": "^2.1.4",
"picocolors": "^1.1.0",
"string-width": "^4.2.3"
},
"jest": {
Expand Down
6 changes: 3 additions & 3 deletions src/formatters/eslintError.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use strict'

const concat = require('../utils').concat
const chalk = require('chalk')
const pc = require('picocolors')

const infos = [
'You may use special comments to disable some warnings.',
'Use ' + chalk.yellow('// eslint-disable-next-line') + ' to ignore the next line.',
'Use ' + chalk.yellow('/* eslint-disable */') + ' to ignore all warnings in a file.'
'Use ' + pc.yellow('// eslint-disable-next-line') + ' to ignore the next line.',
'Use ' + pc.yellow('/* eslint-disable */') + ' to ignore all warnings in a file.'
]

function displayError (error) {
Expand Down
4 changes: 2 additions & 2 deletions src/reporters/base.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { colors, formatTitle, formatText, clearConsole } = require('../utils/log')
const chalk = require('chalk')
const pc = require('picocolors')
const stringWidth = require('string-width')

class BaseReporter {
Expand Down Expand Up @@ -45,7 +45,7 @@ class BaseReporter {
appendTimestamp (title, message) {
// Make timestamp appear at the end of the line
const line = `${title} ${message}`
const dateString = chalk.grey(new Date().toLocaleTimeString())
const dateString = pc.gray(new Date().toLocaleTimeString())
let logSpace = process.stdout.columns - stringWidth(line) - stringWidth(dateString)
if (logSpace <= 0) {
logSpace = 10
Expand Down
6 changes: 3 additions & 3 deletions src/utils/log.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const chalk = require('chalk')
const pc = require('picocolors')

const colors = {
success: 'green',
Expand Down Expand Up @@ -32,11 +32,11 @@ function capitalizeFirstLetter (string) {
}

function formatTitle (severity, title) {
return chalk[bgColor(severity)].black('', title, '')
return pc[bgColor(severity)](pc.black(` ${title} `))
}

function formatText (severity, message) {
return chalk[textColor(severity)](message)
return pc[textColor(severity)](message)
}

function clearConsole () {
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5489,6 +5489,11 @@ picocolors@^1.0.0:
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==

picocolors@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.0.tgz#5358b76a78cde483ba5cef6a9dc9671440b27d59"
integrity sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==

picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
Expand Down