question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix SNYK-JS-ANSIREGEX-1583908 and move to ESM

See original GitHub issue

Is your feature request related to a problem or a nice-to-have?? Please describe.

As of https://snyk.io/vuln/SNYK-JS-ANSIREGEX-1583908 my investigations lead to mocha referencing the vulnerability by peer dependencies of "wide-align": "v1.1.3" -> "string-width": "^1.0.2 || 2" -> "strip-ansi": "^4.0.0" -> "ansi-regex": "^3.0.0".

Describe the solution you’d like

Forcing @iarna to accept https://github.com/iarna/wide-align/pull/57 from @jimmywarting will update "string-width": "^5.0.1" resulting in a fix of https://snyk.io/vuln/SNYK-JS-ANSIREGEX-1583908 with peer-dependencies "strip-ansi": "^7.0.1" -> "ansi-regex": "^6.0.1". It will require some changes towards ESM on mocha-side too: https://github.com/mochajs/mocha/blob/27bfc7425fed7a9a9cadb6dabc536a0bd32abd7a/lib/cli/one-and-dones.js#L11

Describe alternatives you’ve considered

Alternatively the use of @jimmywarting branch https://github.com/jimmywarting/wide-align/tree/esm as dependency, or investigation of a replacement for string-width are thinkable.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dhuang612commented, Sep 17, 2021

Sure, I can try to work on this

1reaction
juergbacommented, Sep 22, 2021

@dhuang612 I will publish a new release this weekend, probably. I would take over this one, unless your PR is ready within the next days. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Eventually, the Node ecosystem has to move to ESM #3689
However, moving from CommonJS (require('some-package')) to ESM import 'some-package' is a breaking change at many levels. I will not go in-depth about those ......
Read more >
How to move to ESM - Stack Overflow
You seem to be overlooking a particular point in the changelog you linked: If you cannot move to ESM yet, don't upgrade to...
Read more >
All you need to know to move from CommonJS to ECMAScript ...
We have a lot to cover, so let's jump into it! Enabling ECMAScript modules (ESM) in Node.js; Syntax; Strict by default; Browser compatibility ......
Read more >
Migrating an NPM package to use ES Modules - Medium
In this article, I'm going to show you the steps needed to convert an NPM package from using CommonJS (CJS) modules, to the...
Read more >
Documentation - ECMAScript Modules in Node.js - TypeScript
Interoperating between the two module systems brings large challenges, with many new features to juggle; however, support for ESM in Node.js is now...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found