@@ -44,7 +44,7 @@ import * as path from 'path';
4444import * as process from 'process' ;
4545import * as winston from 'winston' ;
4646
47- // eslint-disable-next-line @typescript-eslint/no-var-requires
47+ // eslint-disable-next-line @typescript-eslint/no-require-imports
4848const c32check = require ( 'c32check' ) ;
4949
5050import { UserData } from '@stacks/auth' ;
@@ -466,6 +466,7 @@ async function migrateSubdomains(_network: CLINetworkAdapter, args: string[]): P
466466 return fetch ( migrationURL , options )
467467 . then ( response => {
468468 if ( response . status === 404 ) {
469+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
469470 return Promise . reject ( {
470471 status : response . status ,
471472 error : response . statusText ,
@@ -520,6 +521,7 @@ function balance(_network: CLINetworkAdapter, args: string[]): Promise<string> {
520521 return fetch ( `${ url } ${ ACCOUNT_PATH } /${ address } ?proof=0` )
521522 . then ( response => {
522523 if ( response . status === 404 ) {
524+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
523525 return Promise . reject ( {
524526 status : response . status ,
525527 error : response . statusText ,
@@ -1229,7 +1231,7 @@ function gaiaDumpBucket(_network: CLINetworkAdapter, args: string[]): Promise<st
12291231
12301232 console . log ( `Download ${ fileUrl } to ${ destPath } ` ) ;
12311233 return fetch ( fileUrl )
1232- . then ( ( resp : any ) => {
1234+ . then ( ( resp ) : Promise < string | ArrayBuffer > => {
12331235 if ( resp . status !== 200 ) {
12341236 throw new Error ( `Bad status code for ${ fileUrl } : ${ resp . status } ` ) ;
12351237 }
@@ -1246,12 +1248,16 @@ function gaiaDumpBucket(_network: CLINetworkAdapter, args: string[]): Promise<st
12461248 return resp . arrayBuffer ( ) ;
12471249 }
12481250 } )
1249- . then ( ( filebytes : Buffer | ArrayBuffer ) => {
1251+ . then ( ( filebytes : string | ArrayBuffer ) => {
12501252 return new Promise ( ( resolve , reject ) => {
12511253 try {
1252- fs . writeFileSync ( destPath , Buffer . from ( filebytes ) , { encoding : null , mode : 0o660 } ) ;
1254+ fs . writeFileSync ( destPath , Buffer . from ( filebytes as ArrayBuffer ) , {
1255+ encoding : null ,
1256+ mode : 0o660 ,
1257+ } ) ;
12531258 resolve ( ) ;
12541259 } catch ( e ) {
1260+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
12551261 reject ( e ) ;
12561262 }
12571263 } ) ;
@@ -2118,7 +2124,7 @@ export function CLIMain() {
21182124 . then ( ( result : string | Buffer ) => {
21192125 try {
21202126 // if this is a JSON object with 'status', set the exit code
2121- if ( result instanceof Buffer ) {
2127+ if ( Buffer . isBuffer ( result ) ) {
21222128 return result ;
21232129 } else {
21242130 const resJson : any = JSON . parse ( result ) ;
0 commit comments