File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 11'use strict'
2+ const { builtinModules : builtins } = require ( 'module' )
23
34var scopedPackagePattern = new RegExp ( '^(?:@([^/]+?)[/])?([^/]+?)$' )
4- var builtins = require ( 'builtins' )
55var blacklist = [
66 'node_modules' ,
77 'favicon.ico' ,
@@ -52,11 +52,9 @@ function validate (name) {
5252 // Generate warnings for stuff that used to be allowed
5353
5454 // core module names like http, events, util, etc
55- builtins ( { version : '*' } ) . forEach ( function ( builtin ) {
56- if ( name . toLowerCase ( ) === builtin ) {
57- warnings . push ( builtin + ' is a core module name' )
58- }
59- } )
55+ if ( builtins . includes ( name . toLowerCase ( ) ) ) {
56+ warnings . push ( name + ' is a core module name' )
57+ }
6058
6159 if ( name . length > 214 ) {
6260 warnings . push ( 'name can no longer contain more than 214 characters' )
Original file line number Diff line number Diff line change 66 "directories" : {
77 "test" : " test"
88 },
9- "dependencies" : {
10- "builtins" : " ^5.0.0"
11- },
129 "devDependencies" : {
1310 "@npmcli/eslint-config" : " ^4.0.0" ,
1411 "@npmcli/template-oss" : " 4.21.3" ,
You can’t perform that action at this time.
0 commit comments