-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
disallow names of node core modules #2
Conversation
Ok but currently this is a warning and AFAIK it needs to stay that way as we still have some packages published under core module names (see |
I see. @iarna, do you think the warning-ness should be the responsibility of this package? If so, maybe the response object could look like this: {
valid: false,
errors: ['foo'],
warnings: ['bar']
} @maxogden just pointed out to me that there's already a thing that is the same as |
Yeah, disallowing core module names is a bad idea, but warning is fine (that's already the current npm behavior). Browserify, and many others, depend on modules with names that match core. Examples:
To depend on modules that match core names, you just append a forward slash. Like this: |
@zeke Yeah, i'd be happy getting back an error and a warning list– that interface looks great. |
I added support for warnings in the commits above. Take a look and let me know what you think. |
LGTM! 👍 |
disallow names of node core modules
Version 2 just landed with warnings and a new boolean for validity of legacy packages names. See https://www.npmjs.com/package/validate-npm-package-name#legacy-names |
For the consideration of @othiym23 and @iarna, I present a possible implementation of #1.
Twas a good excuse to write node-core-module-names, my smallest npm package yet.
cc @robertkowalski