Skip to content

new rule for preventing installation of core modules? #2122

@jacekkopecky

Description

@jacekkopecky

A typical error that my students make is npm install fs. fs is a core module and as such should not be npm-installed.

In fact, NPMJS has a package named fs (version 0.0.1-security), for which they say:

This package name is not currently in use, but was formerly occupied by another package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we'll probably give it to you if you want it.

I suspect that a package like this might make sense in browser use (not with node.js); but in node.js environment, it should be prevented as it looks ripe for malice.

Therefore, the import plugin could complain if I have a core module in dependencies or devDependencies and I write code like this:

import * as fs from 'fs';

Please be kind if I'm missing something obvious. 8-)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions