morgan icon indicating copy to clipboard operation
morgan copied to clipboard

A11y: support NO_COLOR environment variable in output

Open MaddyGuthridge opened this issue 6 months ago • 0 comments

Resolves #302

This is a quick fix, rather than a major change to the system Morgan uses for styled console output. In an ideal world, using NO_COLOR would disable all styling of output, which would remove the presence of control characters in things like CI logs. Currently, this PR just sets the color to 0 if NO_COLOR is set in process.env, which is acceptable for accessibility.

As a side note: I'm not used to writing code for such old versions of Node, so apologies if I made any mistakes that break that compatibility. I tried testing using Node 0.8.28, but was unable to get npm i to work correctly. Let me know if I broke anything and I'll do my best to fix it up :)

  • [x] Implementation
  • [x] Test suite passes with 100% coverage
  • [x] Linting passes with no errors or warnings

I accept the certificate of origin, and am happy for my contribution to use the project's MIT software license.

MaddyGuthridge avatar May 29 '25 06:05 MaddyGuthridge