Closed mattbrictson closed 3 days ago
@mattbrictson,
Thank you for letting me know. I'll take a look at it.
That was a strange decision to mess with the output color for all cli applications.
However, it does this using console.error, which is intended to be used for actual errors. Starting in Node 20.15, console.error is colored red on supported terminals to reinforce this purpose.
Since when did the meaning of console.error
change to mean it is only for "actual" errors?
I don't see anything in the docs:
Kind of Issue
Runtime - command-line tools
Tool or Library
cspell
Version
8.8.4
Supporting Library
Not sure / None
OS
macOS
OS Version
macOS 14.5 (23F79)
Description
Cspell prints its summary output to stderr, which is expected.
However, it does this using
console.error
, which is intended to be used for actual errors. Starting in Node 20.15,console.error
is colored red on supported terminals to reinforce this purpose.Thus, even when cspell runs successfully with no issues found, on Node 20.15+ the red output makes it seem like something has gone wrong.
I believe that cspell should emit the summary to stderr, but use a method other than
console.error
. Perhapsprocess.stderr
directly?Steps to Reproduce
node --version
.cspell
and observe that the summary is red, even when there are no issues found.Expected Behavior
Summary output should be red only if something has gone wrong (i.e. one or more issues found).
Additional Information
Node PR that introduced colorized
console.error
: https://github.com/nodejs/node/pull/51629cspell.json
No response
cspell.config.yaml
No response
Example Repository
No response
Code of Conduct