File tree 2 files changed +4
-9
lines changed
2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 1
1
'use strict'
2
+ const { builtinModules : builtins } = require ( 'module' )
2
3
3
4
var scopedPackagePattern = new RegExp ( '^(?:@([^/]+?)[/])?([^/]+?)$' )
4
- var builtins = require ( 'builtins' )
5
5
var blacklist = [
6
6
'node_modules' ,
7
7
'favicon.ico' ,
@@ -52,11 +52,9 @@ function validate (name) {
52
52
// Generate warnings for stuff that used to be allowed
53
53
54
54
// 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
+ }
60
58
61
59
if ( name . length > 214 ) {
62
60
warnings . push ( 'name can no longer contain more than 214 characters' )
Original file line number Diff line number Diff line change 6
6
"directories" : {
7
7
"test" : " test"
8
8
},
9
- "dependencies" : {
10
- "builtins" : " ^5.0.0"
11
- },
12
9
"devDependencies" : {
13
10
"@npmcli/eslint-config" : " ^4.0.0" ,
14
11
"@npmcli/template-oss" : " 4.21.3" ,
You can’t perform that action at this time.
0 commit comments