File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,9 @@ export function PackageName(
223
223
const message = useComputed ( ( ) => {
224
224
if ( error . value ) return error . value ;
225
225
if ( name . value . length === 0 ) return "" ;
226
+ if ( name . value . startsWith ( "@" ) ) {
227
+ return "Enter only the package name, do not include the scope." ;
228
+ }
226
229
if ( name . value . length > 32 ) {
227
230
return "Package name cannot be longer than 32 characters." ;
228
231
}
@@ -239,8 +242,9 @@ export function PackageName(
239
242
const scope_ = scope . value ;
240
243
const newName = name . value ;
241
244
if (
242
- scope_ === "" || newName . length < 2 || scope_ . includes ( "_" ) ||
243
- newName . includes ( "_" )
245
+ scope_ === "" || newName . length < 2 ||
246
+ ! / ^ [ a - z 0 - 9 ] [ a - z 0 - 9 \- ] + $ / . test ( scope_ ) ||
247
+ ! / ^ [ a - z 0 - 9 ] [ a - z 0 - 9 \- ] + $ / . test ( newName )
244
248
) {
245
249
pkg . value = undefined ;
246
250
return ;
You can’t perform that action at this time.
0 commit comments