@@ -263,13 +263,15 @@ const args: Record<ArgName, yargs.Options> = {
263263 } ,
264264} ;
265265
266+ // FIXME: fix the type
267+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
266268async function create ( argv : yargs . Arguments < any > ) {
267269 let local = false ;
268270
269271 if ( typeof argv . local === 'boolean' ) {
270272 local = argv . local ;
271273 } else {
272- let hasPackageJson = await fs . pathExists (
274+ const hasPackageJson = await fs . pathExists (
273275 path . join ( process . cwd ( ) , 'package.json' )
274276 ) ;
275277
@@ -397,7 +399,7 @@ async function create(argv: yargs.Arguments<any>) {
397399 type : local ? null : 'text' ,
398400 name : 'authorUrl' ,
399401 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
401403 initial : async ( previous : string ) => {
402404 try {
403405 const username = await githubUsername ( previous ) ;
@@ -415,7 +417,6 @@ async function create(argv: yargs.Arguments<any>) {
415417 type : local ? null : 'text' ,
416418 name : 'repoUrl' ,
417419 message : 'What is the URL for the repository?' ,
418- // @ts -ignore: this is supported, but types are wrong
419420 initial : ( _ : string , answers : Answers ) => {
420421 if ( / ^ h t t p s ? : \/ \/ g i t h u b .c o m \/ [ ^ / ] + / . test ( answers . authorUrl ) ) {
421422 return `${ answers . authorUrl } /${ answers . slug
@@ -550,9 +551,9 @@ async function create(argv: yargs.Arguments<any>) {
550551
551552 try {
552553 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+ } ) ,
556557 spawn ( 'npm' , [ 'view' , 'react-native-builder-bob' , 'dist-tags.latest' ] ) ,
557558 ] ) ;
558559 } catch ( e ) {
@@ -870,8 +871,8 @@ async function create(argv: yargs.Arguments<any>) {
870871 . map (
871872 ( [ script , { name, color } ] ) => `
872873 ${ kleur [ color ] ( `Run the example app on ${ kleur . bold ( name ) } ` ) } ${ kleur . gray (
873- ':'
874- ) }
874+ ':'
875+ ) }
875876
876877 ${ kleur . gray ( '$' ) } yarn example ${ script } `
877878 )
@@ -884,7 +885,7 @@ async function create(argv: yargs.Arguments<any>) {
884885 ) ;
885886 }
886887}
887- // eslint-disable-next-line babel/no-unused-expressions
888+
888889yargs
889890 . command ( '$0 [name]' , 'create a react native library' , args , create )
890891 . demandCommand ( )
0 commit comments