tooling icon indicating copy to clipboard operation
tooling copied to clipboard

Alert end-users to features that were added to Node.js core when using a package/shim/etc

Open joesepi opened this issue 4 years ago • 2 comments

We've started incorporating some third-party packages like mkdirp and rimraf into Node core. We should figure out a way to flag this to users if they're using the package in their code. In some cases the npm packages provide additional functionality, for example rimraf also provides binlinks so we probably only want to flag certain usages.

Related: #110

joesepi avatar Jun 25 '21 20:06 joesepi

If the node runtime is going to do this (it probably should be an eslint plugin instead), it must:

  • never flag third-party code (ie, inside node_modules) because that's not actionable
  • not flag first-party code when the "engines" field declares support for a version of node that lacks the core module, because that would likely cause unexpected breakage for consumers

ljharb avatar Jun 25 '21 20:06 ljharb

We discussed this in the tooling meeting today and had the idea of creating a small standalone package you could run in a project that would scan your code and dependencies and generate a list of recommendations for moving from third-party packages to built in functionality. We're going to build a prototype of this and see how it works. We're still open to other ideas as well though.

iansu avatar Jul 09 '21 20:07 iansu