@@ -268,8 +268,8 @@ const args: Record<ArgName, yargs.Options> = {
268
268
// FIXME: fix the type
269
269
// eslint-disable-next-line @typescript-eslint/no-explicit-any
270
270
async function create ( _argv : yargs . Arguments < any > ) {
271
- const { _ , $0 , ... argv } = _argv ;
272
-
271
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
272
+ const { _ , $0 , ... argv } = _argv ;
273
273
274
274
let local = false ;
275
275
@@ -366,7 +366,7 @@ async function create(_argv: yargs.Arguments<any>) {
366
366
validate ?: ( value : string ) => boolean | string ;
367
367
}
368
368
> = {
369
- ' slug' : {
369
+ slug : {
370
370
type : 'text' ,
371
371
name : 'slug' ,
372
372
message : 'What is the name of the npm package?' ,
@@ -379,28 +379,28 @@ async function create(_argv: yargs.Arguments<any>) {
379
379
validateNpmPackage ( input ) . validForNewPackages ||
380
380
'Must be a valid npm package name' ,
381
381
} ,
382
- ' description' : {
382
+ description : {
383
383
type : 'text' ,
384
384
name : 'description' ,
385
385
message : 'What is the description for the package?' ,
386
386
validate : ( input ) => Boolean ( input ) || 'Cannot be empty' ,
387
387
} ,
388
- ' authorName' : {
388
+ authorName : {
389
389
type : local ? null : 'text' ,
390
390
name : 'authorName' ,
391
391
message : 'What is the name of package author?' ,
392
392
initial : name ,
393
393
validate : ( input ) => Boolean ( input ) || 'Cannot be empty' ,
394
394
} ,
395
- ' authorEmail' : {
395
+ authorEmail : {
396
396
type : local ? null : 'text' ,
397
397
name : 'authorEmail' ,
398
398
message : 'What is the email address for the package author?' ,
399
399
initial : email ,
400
400
validate : ( input ) =>
401
401
/ ^ \S + @ \S + $ / . test ( input ) || 'Must be a valid email address' ,
402
402
} ,
403
- ' authorUrl' : {
403
+ authorUrl : {
404
404
type : local ? null : 'text' ,
405
405
name : 'authorUrl' ,
406
406
message : 'What is the URL for the package author?' ,
@@ -418,7 +418,7 @@ async function create(_argv: yargs.Arguments<any>) {
418
418
} ,
419
419
validate : ( input ) => / ^ h t t p s ? : \/ \/ / . test ( input ) || 'Must be a valid URL' ,
420
420
} ,
421
- ' repoUrl' : {
421
+ repoUrl : {
422
422
type : local ? null : 'text' ,
423
423
name : 'repoUrl' ,
424
424
message : 'What is the URL for the repository?' ,
@@ -433,13 +433,13 @@ async function create(_argv: yargs.Arguments<any>) {
433
433
} ,
434
434
validate : ( input ) => / ^ h t t p s ? : \/ \/ / . test ( input ) || 'Must be a valid URL' ,
435
435
} ,
436
- ' type' : {
436
+ type : {
437
437
type : 'select' ,
438
438
name : 'type' ,
439
439
message : 'What type of library do you want to develop?' ,
440
440
choices : TYPE_CHOICES ,
441
441
} ,
442
- ' languages' : {
442
+ languages : {
443
443
type : 'select' ,
444
444
name : 'languages' ,
445
445
message : 'Which languages do you want to use?' ,
@@ -795,7 +795,7 @@ async function create(_argv: yargs.Arguments<any>) {
795
795
}
796
796
797
797
// Some of the passed args can already be derived from the generated package.json file.
798
- const ignoredAnswers : Array < keyof Answers > = [
798
+ const ignoredAnswers : ( keyof Answers ) [ ] = [
799
799
'name' ,
800
800
'slug' ,
801
801
'description' ,
@@ -814,15 +814,14 @@ async function create(_argv: yargs.Arguments<any>) {
814
814
815
815
const libraryMetadata = Object . fromEntries (
816
816
( Object . entries ( answers ) as AnswerEntries ) . filter (
817
- ( [ answer ] ) =>
818
- ! (
819
- ignoredAnswers . includes ( answer )
820
- )
817
+ ( [ answer ] ) => ! ignoredAnswers . includes ( answer )
821
818
)
822
819
) ;
823
820
libraryMetadata . version = version ;
824
821
825
- const libraryPackageJson = await fs . readJson ( path . join ( folder , 'package.json' ) ) ;
822
+ const libraryPackageJson = await fs . readJson (
823
+ path . join ( folder , 'package.json' )
824
+ ) ;
826
825
libraryPackageJson [ 'create-react-native-library' ] = libraryMetadata ;
827
826
await fs . writeJson ( path . join ( folder , 'package.json' ) , libraryPackageJson , {
828
827
spaces : 2 ,
0 commit comments