Skip to content

🚀 Feature: Replace strip-ansi with util.stripVTControlCharacters #5265

Open
@JoshuaKGoldberg

Description

Feature Request Checklist

Overview

I ran eslint-plugin-depend on the Mocha repo. Here's one of the outputs:

/Users/josh/repos/mocha/docs/_data/usage.js
  3:19  error  "strip-ansi" should be replaced with an alternative package. Read more here: https://github.com/es-tooling/module-replacements/blob/main/docs/modules/strip-ansi.md  depend/ban-dependencies

Perhttps://github.com/es-tooling/module-replacements/blob/main/docs/modules/strip-ansi.md:

strip-ansi is a simple utility function that can be replaced with native APIs.

...

Added in v16.11.0, util.stripVTControlCharacters can be used to strip ANSI escape codes from a string.

Suggested Solution

One less dependency is always nice IMO! Now v11 is shipped and we don't support Node <18.18, I think we can rely on node:util existing.

Proposal: let's drop the strip-ansi dependency in favor of util.stripVTControlCharacters?

Alternatives

We could stay on strip-ansi, but I see no reason to.

Additional Info

💖

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    status: in triagea maintainer should (re-)triage (review) this issuetype: featureenhancement proposal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions