@@ -263,13 +263,15 @@ const args: Record<ArgName, yargs.Options> = {
263
263
} ,
264
264
} ;
265
265
266
+ // FIXME: fix the type
267
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
266
268
async function create ( argv : yargs . Arguments < any > ) {
267
269
let local = false ;
268
270
269
271
if ( typeof argv . local === 'boolean' ) {
270
272
local = argv . local ;
271
273
} else {
272
- let hasPackageJson = await fs . pathExists (
274
+ const hasPackageJson = await fs . pathExists (
273
275
path . join ( process . cwd ( ) , 'package.json' )
274
276
) ;
275
277
@@ -397,7 +399,7 @@ async function create(argv: yargs.Arguments<any>) {
397
399
type : local ? null : 'text' ,
398
400
name : 'authorUrl' ,
399
401
message : 'What is the URL for the package author?' ,
400
- // @ts -ignore: this is supported, but types are wrong
402
+ // @ts -expect-error this is supported, but types are wrong
401
403
initial : async ( previous : string ) => {
402
404
try {
403
405
const username = await githubUsername ( previous ) ;
@@ -415,7 +417,6 @@ async function create(argv: yargs.Arguments<any>) {
415
417
type : local ? null : 'text' ,
416
418
name : 'repoUrl' ,
417
419
message : 'What is the URL for the repository?' ,
418
- // @ts -ignore: this is supported, but types are wrong
419
420
initial : ( _ : string , answers : Answers ) => {
420
421
if ( / ^ h t t p s ? : \/ \/ g i t h u b .c o m \/ [ ^ / ] + / . test ( answers . authorUrl ) ) {
421
422
return `${ answers . authorUrl } /${ answers . slug
@@ -550,9 +551,9 @@ async function create(argv: yargs.Arguments<any>) {
550
551
551
552
try {
552
553
version = await Promise . race ( [
553
- new Promise < string > ( ( resolve ) =>
554
- setTimeout ( ( ) => resolve ( FALLBACK_BOB_VERSION ) , 1000 )
555
- ) ,
554
+ new Promise < string > ( ( resolve ) => {
555
+ setTimeout ( ( ) => resolve ( FALLBACK_BOB_VERSION ) , 1000 ) ;
556
+ } ) ,
556
557
spawn ( 'npm' , [ 'view' , 'react-native-builder-bob' , 'dist-tags.latest' ] ) ,
557
558
] ) ;
558
559
} catch ( e ) {
@@ -870,8 +871,8 @@ async function create(argv: yargs.Arguments<any>) {
870
871
. map (
871
872
( [ script , { name, color } ] ) => `
872
873
${ kleur [ color ] ( `Run the example app on ${ kleur . bold ( name ) } ` ) } ${ kleur . gray (
873
- ':'
874
- ) }
874
+ ':'
875
+ ) }
875
876
876
877
${ kleur . gray ( '$' ) } yarn example ${ script } `
877
878
)
@@ -884,7 +885,7 @@ async function create(argv: yargs.Arguments<any>) {
884
885
) ;
885
886
}
886
887
}
887
- // eslint-disable-next-line babel/no-unused-expressions
888
+
888
889
yargs
889
890
. command ( '$0 [name]' , 'create a react native library' , args , create )
890
891
. demandCommand ( )
0 commit comments