diff --git a/packages/eas-cli/src/.eslintrc.js b/packages/eas-cli/src/.eslintrc.js index 3f90d6a6a3..09987d51c1 100644 --- a/packages/eas-cli/src/.eslintrc.js +++ b/packages/eas-cli/src/.eslintrc.js @@ -14,7 +14,7 @@ module.exports = { }, ], '@typescript-eslint/prefer-nullish-coalescing': ['warn', { ignorePrimitives: true }], - // '@typescript-eslint/no-confusing-void-expression': 'warn', + '@typescript-eslint/no-confusing-void-expression': 'warn', // '@typescript-eslint/await-thenable': 'error', // '@typescript-eslint/no-misused-promises': [ // 'error', diff --git a/packages/eas-cli/src/branch/queries.ts b/packages/eas-cli/src/branch/queries.ts index 88b9496b42..de314becca 100644 --- a/packages/eas-cli/src/branch/queries.ts +++ b/packages/eas-cli/src/branch/queries.ts @@ -84,7 +84,9 @@ export async function listAndRenderBranchesOnAppAsync( queryBranchesOnProjectAsync(graphqlClient, limit, offset, projectId), promptOptions: { title: 'Load more branches?', - renderListItems: branches => renderPageOfBranches(branches, paginatedQueryOptions), + renderListItems: branches => { + renderPageOfBranches(branches, paginatedQueryOptions); + }, }, }); } diff --git a/packages/eas-cli/src/build/build.ts b/packages/eas-cli/src/build/build.ts index 8226d287c7..4ec4f6e291 100644 --- a/packages/eas-cli/src/build/build.ts +++ b/packages/eas-cli/src/build/build.ts @@ -130,7 +130,9 @@ export async function prepareBuildRequestForPlatformAsync< await withAnalyticsAsync( ctx.analytics, - async () => await builder.syncProjectConfigurationAsync(ctx), + async () => { + await builder.syncProjectConfigurationAsync(ctx); + }, { attemptEvent: BuildEvent.CONFIGURE_PROJECT_ATTEMPT, successEvent: BuildEvent.CONFIGURE_PROJECT_SUCCESS, diff --git a/packages/eas-cli/src/build/queries.ts b/packages/eas-cli/src/build/queries.ts index d59b0ef728..163b985e46 100644 --- a/packages/eas-cli/src/build/queries.ts +++ b/packages/eas-cli/src/build/queries.ts @@ -50,8 +50,9 @@ export async function listAndRenderBuildsOnAppAsync( }), promptOptions: { title: 'Load more builds?', - renderListItems: builds => - renderPageOfBuilds({ builds, projectDisplayName, paginatedQueryOptions }), + renderListItems: builds => { + renderPageOfBuilds({ builds, projectDisplayName, paginatedQueryOptions }); + }, }, }); } diff --git a/packages/eas-cli/src/build/utils/printBuildInfo.ts b/packages/eas-cli/src/build/utils/printBuildInfo.ts index 16a907c22b..515b32ff9c 100644 --- a/packages/eas-cli/src/build/utils/printBuildInfo.ts +++ b/packages/eas-cli/src/build/utils/printBuildInfo.ts @@ -62,7 +62,9 @@ export function printBuildResults(builds: (BuildFragment | null)[]): void { assert(build, 'Build should be defined'); printBuildResult(build); } else { - (builds.filter(i => i) as BuildFragment[]).forEach(build => printBuildResult(build)); + (builds.filter(i => i) as BuildFragment[]).forEach(build => { + printBuildResult(build); + }); } } @@ -97,9 +99,9 @@ function printBuildResult(build: BuildFragment): void { // to the build details page and let people press the button to download there const qrcodeUrl = build.platform === AppPlatform.Ios ? getInternalDistributionInstallUrl(build) : logsUrl; - qrcodeTerminal.generate(qrcodeUrl, { small: true }, code => - Log.log(`${indentString(code, 2)}\n`) - ); + qrcodeTerminal.generate(qrcodeUrl, { small: true }, code => { + Log.log(`${indentString(code, 2)}\n`); + }); Log.log( `${appPlatformEmojis[build.platform]} Open this link on your ${ appPlatformDisplayNames[build.platform] diff --git a/packages/eas-cli/src/channel/__tests__/branch-mapping-test.ts b/packages/eas-cli/src/channel/__tests__/branch-mapping-test.ts index 408d90c656..4633b88289 100644 --- a/packages/eas-cli/src/channel/__tests__/branch-mapping-test.ts +++ b/packages/eas-cli/src/channel/__tests__/branch-mapping-test.ts @@ -17,7 +17,9 @@ import { describe(assertVersion, () => { it('throws if the branch mapping is not the correct version', () => { - expect(() => assertVersion(testChannelBasicInfo, 5)).toThrowError(BranchMappingValidationError); + expect(() => { + assertVersion(testChannelBasicInfo, 5); + }).toThrowError(BranchMappingValidationError); }); it('asserts the correct version', () => { assertVersion(testChannelBasicInfo, 0); diff --git a/packages/eas-cli/src/channel/queries.ts b/packages/eas-cli/src/channel/queries.ts index aab4d818e1..e451a4852a 100644 --- a/packages/eas-cli/src/channel/queries.ts +++ b/packages/eas-cli/src/channel/queries.ts @@ -89,7 +89,9 @@ export async function listAndRenderChannelsOnAppAsync( queryChannelsOnAppAsync(graphqlClient, { limit, offset, appId: projectId }), promptOptions: { title: 'Load more channels?', - renderListItems: channels => renderPageOfChannels(channels, paginatedQueryOptions), + renderListItems: channels => { + renderPageOfChannels(channels, paginatedQueryOptions); + }, }, }); } @@ -131,8 +133,9 @@ export async function listAndRenderBranchesAndUpdatesOnChannelAsync( }), promptOptions: { title: 'Load more channels?', - renderListItems: branches => - renderPageOfBranchesOnChannel(channel, branches, paginatedQueryOptions), + renderListItems: branches => { + renderPageOfBranchesOnChannel(channel, branches, paginatedQueryOptions); + }, }, }); } diff --git a/packages/eas-cli/src/commandUtils/gating/FeatureGating.ts b/packages/eas-cli/src/commandUtils/gating/FeatureGating.ts index 813f075a34..0967e31706 100644 --- a/packages/eas-cli/src/commandUtils/gating/FeatureGating.ts +++ b/packages/eas-cli/src/commandUtils/gating/FeatureGating.ts @@ -63,7 +63,11 @@ export default class FeatureGating { } public static overrideKeyForEachInTest(key: FeatureGateKey, enabled: boolean): void { - beforeEach(() => FeatureGateTestOverrides.setOverride(key, enabled)); - afterEach(() => FeatureGateTestOverrides.removeOverride(key)); + beforeEach(() => { + FeatureGateTestOverrides.setOverride(key, enabled); + }); + afterEach(() => { + FeatureGateTestOverrides.removeOverride(key); + }); } } diff --git a/packages/eas-cli/src/commands/metadata/lint.ts b/packages/eas-cli/src/commands/metadata/lint.ts index b62ecaff43..afd7293e98 100644 --- a/packages/eas-cli/src/commands/metadata/lint.ts +++ b/packages/eas-cli/src/commands/metadata/lint.ts @@ -60,7 +60,8 @@ export default class MetadataLint extends EasCommand { await loadConfigAsync({ projectDir, profile: submitProfile }); if (flags.json) { - return printJsonOnlyOutput([]); + printJsonOnlyOutput([]); + return; } Log.log('✅ Store configuration is valid.'); @@ -70,7 +71,8 @@ export default class MetadataLint extends EasCommand { } if (flags.json) { - return printJsonOnlyOutput(error.errors); + printJsonOnlyOutput(error.errors); + return; } logMetadataValidationError(error); diff --git a/packages/eas-cli/src/commands/update/__tests__/republish.test.ts b/packages/eas-cli/src/commands/update/__tests__/republish.test.ts index cdf38f7cfa..c112ad0b44 100644 --- a/packages/eas-cli/src/commands/update/__tests__/republish.test.ts +++ b/packages/eas-cli/src/commands/update/__tests__/republish.test.ts @@ -55,7 +55,9 @@ jest.mock('../../../utils/code-signing'); jest.mock('../../../fetch'); describe(UpdateRepublish.name, () => { - afterEach(() => vol.reset()); + afterEach(() => { + vol.reset(); + }); it('errors when providing both --group and --branch', async () => { const flags = ['--group=1234', '--branch=main']; diff --git a/packages/eas-cli/src/commands/update/__tests__/roll-back-to-embedded.test.ts b/packages/eas-cli/src/commands/update/__tests__/roll-back-to-embedded.test.ts index 98f9814171..fe66cc486e 100644 --- a/packages/eas-cli/src/commands/update/__tests__/roll-back-to-embedded.test.ts +++ b/packages/eas-cli/src/commands/update/__tests__/roll-back-to-embedded.test.ts @@ -68,7 +68,9 @@ jest.mock('../../../project/publish', () => ({ })); describe(UpdateRollBackToEmbedded.name, () => { - afterEach(() => vol.reset()); + afterEach(() => { + vol.reset(); + }); it('errors with both --channel and --branch', async () => { const flags = ['--channel=channel123', '--branch=branch123']; diff --git a/packages/eas-cli/src/credentials/android/api/GraphqlClient.ts b/packages/eas-cli/src/credentials/android/api/GraphqlClient.ts index f6627ac324..0fa9c0519b 100644 --- a/packages/eas-cli/src/credentials/android/api/GraphqlClient.ts +++ b/packages/eas-cli/src/credentials/android/api/GraphqlClient.ts @@ -279,7 +279,7 @@ export async function deleteKeystoreAsync( graphqlClient: ExpoGraphqlClient, keystore: AndroidKeystoreFragment ): Promise { - return await AndroidKeystoreMutation.deleteAndroidKeystoreAsync(graphqlClient, keystore.id); + await AndroidKeystoreMutation.deleteAndroidKeystoreAsync(graphqlClient, keystore.id); } export async function createFcmAsync( @@ -299,7 +299,7 @@ export async function deleteFcmAsync( graphqlClient: ExpoGraphqlClient, fcm: AndroidFcmFragment ): Promise { - return await AndroidFcmMutation.deleteAndroidFcmAsync(graphqlClient, fcm.id); + await AndroidFcmMutation.deleteAndroidFcmAsync(graphqlClient, fcm.id); } export async function createGoogleServiceAccountKeyAsync( @@ -318,7 +318,7 @@ export async function deleteGoogleServiceAccountKeyAsync( graphqlClient: ExpoGraphqlClient, googleServiceAccountKey: GoogleServiceAccountKeyFragment ): Promise { - return await GoogleServiceAccountKeyMutation.deleteGoogleServiceAccountKeyAsync( + await GoogleServiceAccountKeyMutation.deleteGoogleServiceAccountKeyAsync( graphqlClient, googleServiceAccountKey.id ); diff --git a/packages/eas-cli/src/credentials/android/utils/__tests__/keystoreNew-test.ts b/packages/eas-cli/src/credentials/android/utils/__tests__/keystoreNew-test.ts index 4108e0c9f0..68e5d1c947 100644 --- a/packages/eas-cli/src/credentials/android/utils/__tests__/keystoreNew-test.ts +++ b/packages/eas-cli/src/credentials/android/utils/__tests__/keystoreNew-test.ts @@ -39,37 +39,49 @@ describe('validateKeystore', () => { it('validates a correctly formatted jks keystore', async () => { const keystoreWithType = getKeystoreWithType(testKeystore); expect(keystoreWithType.type).toBe(AndroidKeystoreType.Jks); - expect(() => validateKeystore(keystoreWithType)).not.toThrow(); + expect(() => { + validateKeystore(keystoreWithType); + }).not.toThrow(); }); it('doesnt validate a jks keystore with wrong alias', async () => { const keystoreWithType = getKeystoreWithType({ ...testKeystore, keyAlias: 'non-existent-alias', }); - expect(() => validateKeystore(keystoreWithType)).toThrow(); + expect(() => { + validateKeystore(keystoreWithType); + }).toThrow(); }); it('doesnt validate a jks keystore with wrong key password', async () => { const keystoreWithType = getKeystoreWithType({ ...testKeystore, keyPassword: 'not-the-password', }); - expect(() => validateKeystore(keystoreWithType)).toThrow(); + expect(() => { + validateKeystore(keystoreWithType); + }).toThrow(); }); it('validates a correctly formatted pkcs 12 keystore', async () => { const keystoreWithType = getKeystoreWithType(testPKCS12Keystore); expect(keystoreWithType.type).toBe(AndroidKeystoreType.Pkcs12); - expect(() => validateKeystore(keystoreWithType)).not.toThrow(); + expect(() => { + validateKeystore(keystoreWithType); + }).not.toThrow(); }); it('doesnt validate a PKCS 12 keystore with wrong alias', async () => { const keystoreWithType = getKeystoreWithType({ ...testPKCS12Keystore, keyAlias: 'non-existent-alias', }); - expect(() => validateKeystore(keystoreWithType)).toThrow(); + expect(() => { + validateKeystore(keystoreWithType); + }).toThrow(); }); it('validates an PKCS 12 Keystore with an empty password', async () => { const keystoreWithType = getKeystoreWithType(testPKCS12EmptyPasswordKeystore); expect(keystoreWithType.type).toBe(AndroidKeystoreType.Pkcs12); - expect(() => validateKeystore(keystoreWithType)).not.toThrow(); + expect(() => { + validateKeystore(keystoreWithType); + }).not.toThrow(); }); }); diff --git a/packages/eas-cli/src/credentials/ios/api/GraphqlClient.ts b/packages/eas-cli/src/credentials/ios/api/GraphqlClient.ts index fbe83f9c64..ae9f986a66 100644 --- a/packages/eas-cli/src/credentials/ios/api/GraphqlClient.ts +++ b/packages/eas-cli/src/credentials/ios/api/GraphqlClient.ts @@ -388,7 +388,7 @@ export async function deleteProvisioningProfilesAsync( graphqlClient: ExpoGraphqlClient, appleProvisioningProfileIds: string[] ): Promise { - return await AppleProvisioningProfileMutation.deleteAppleProvisioningProfilesAsync( + await AppleProvisioningProfileMutation.deleteAppleProvisioningProfilesAsync( graphqlClient, appleProvisioningProfileIds ); @@ -445,7 +445,7 @@ export async function deleteDistributionCertificateAsync( graphqlClient: ExpoGraphqlClient, distributionCertificateId: string ): Promise { - return await AppleDistributionCertificateMutation.deleteAppleDistributionCertificateAsync( + await AppleDistributionCertificateMutation.deleteAppleDistributionCertificateAsync( graphqlClient, distributionCertificateId ); @@ -493,7 +493,7 @@ export async function deletePushKeyAsync( graphqlClient: ExpoGraphqlClient, pushKeyId: string ): Promise { - return await ApplePushKeyMutation.deleteApplePushKeyAsync(graphqlClient, pushKeyId); + await ApplePushKeyMutation.deleteApplePushKeyAsync(graphqlClient, pushKeyId); } export async function createAscApiKeyAsync( @@ -543,10 +543,7 @@ export async function deleteAscApiKeyAsync( graphqlClient: ExpoGraphqlClient, ascApiKeyId: string ): Promise { - return await AppStoreConnectApiKeyMutation.deleteAppStoreConnectApiKeyAsync( - graphqlClient, - ascApiKeyId - ); + await AppStoreConnectApiKeyMutation.deleteAppStoreConnectApiKeyAsync(graphqlClient, ascApiKeyId); } function convertUserRoleToGraphqlType(userRole: UserRole): AppStoreConnectUserRole { diff --git a/packages/eas-cli/src/credentials/ios/appstore/AppStoreApi.ts b/packages/eas-cli/src/credentials/ios/appstore/AppStoreApi.ts index 19304d18b8..81a377511a 100644 --- a/packages/eas-cli/src/credentials/ios/appstore/AppStoreApi.ts +++ b/packages/eas-cli/src/credentials/ios/appstore/AppStoreApi.ts @@ -84,7 +84,7 @@ export default class AppStoreApi { options?: IosCapabilitiesOptions ): Promise { const ctx = await this.ensureAuthenticatedAsync(); - return await ensureBundleIdExistsAsync(ctx, app, options); + await ensureBundleIdExistsAsync(ctx, app, options); } public async listDistributionCertificatesAsync(): Promise { @@ -99,7 +99,7 @@ export default class AppStoreApi { public async revokeDistributionCertificateAsync(ids: string[]): Promise { const ctx = await this.ensureAuthenticatedAsync(); - return await revokeDistributionCertificateAsync(ctx, ids); + await revokeDistributionCertificateAsync(ctx, ids); } public async listPushKeysAsync(): Promise { @@ -114,7 +114,7 @@ export default class AppStoreApi { public async revokePushKeyAsync(ids: string[]): Promise { const userCtx = await this.ensureUserAuthenticatedAsync(); - return await revokePushKeyAsync(userCtx, ids); + await revokePushKeyAsync(userCtx, ids); } public async useExistingProvisioningProfileAsync( @@ -164,7 +164,7 @@ export default class AppStoreApi { profileClass?: ProfileClass ): Promise { const ctx = await this.ensureAuthenticatedAsync(); - return await revokeProvisioningProfileAsync(ctx, bundleIdentifier, applePlatform, profileClass); + await revokeProvisioningProfileAsync(ctx, bundleIdentifier, applePlatform, profileClass); } public async createOrReuseAdhocProvisioningProfileAsync( diff --git a/packages/eas-cli/src/credentials/ios/appstore/__tests__/bundleIdCapabilities-test.ts b/packages/eas-cli/src/credentials/ios/appstore/__tests__/bundleIdCapabilities-test.ts index 8c5a638175..f177675f79 100644 --- a/packages/eas-cli/src/credentials/ios/appstore/__tests__/bundleIdCapabilities-test.ts +++ b/packages/eas-cli/src/credentials/ios/appstore/__tests__/bundleIdCapabilities-test.ts @@ -11,9 +11,9 @@ describe(assertValidOptions, () => { const classifier = CapabilityMapping.find( ({ capabilityIdPrefix }) => capabilityIdPrefix === 'merchant.' )!; - expect(() => assertValidOptions(classifier, ['foobar'])).toThrowError( - /Expected an array of strings, where each string is prefixed with "merchant."/ - ); + expect(() => { + assertValidOptions(classifier, ['foobar']); + }).toThrowError(/Expected an array of strings, where each string is prefixed with "merchant."/); }); }); diff --git a/packages/eas-cli/src/credentials/ios/appstore/ensureAppExists.ts b/packages/eas-cli/src/credentials/ios/appstore/ensureAppExists.ts index c412f461c5..4fa4accc31 100644 --- a/packages/eas-cli/src/credentials/ios/appstore/ensureAppExists.ts +++ b/packages/eas-cli/src/credentials/ios/appstore/ensureAppExists.ts @@ -25,7 +25,7 @@ export async function ensureBundleIdExistsAsync( { accountName, projectName, bundleIdentifier }: AppLookupParams, options?: IosCapabilitiesOptions ): Promise { - return await ensureBundleIdExistsWithNameAsync( + await ensureBundleIdExistsWithNameAsync( authCtx, { name: `@${accountName}/${projectName}`, diff --git a/packages/eas-cli/src/credentials/ios/appstore/keychain.ts b/packages/eas-cli/src/credentials/ios/appstore/keychain.ts index 4b7578865f..f79c420cdb 100644 --- a/packages/eas-cli/src/credentials/ios/appstore/keychain.ts +++ b/packages/eas-cli/src/credentials/ios/appstore/keychain.ts @@ -27,7 +27,8 @@ export async function deletePasswordAsync({ (error: Error) => { if (error) { if (error.message.match(NO_PASSWORD_REGEX)) { - return resolve(false); + resolve(false); + return; } reject(error); } else { @@ -52,7 +53,8 @@ export async function getPasswordAsync({ (error: Error, password: string) => { if (error) { if (error.message.match(NO_PASSWORD_REGEX)) { - return resolve(null); + resolve(null); + return; } reject(error); } else { diff --git a/packages/eas-cli/src/credentials/manager/ManageAndroid.ts b/packages/eas-cli/src/credentials/manager/ManageAndroid.ts index 5592861692..5db82e3756 100644 --- a/packages/eas-cli/src/credentials/manager/ManageAndroid.ts +++ b/packages/eas-cli/src/credentials/manager/ManageAndroid.ts @@ -143,7 +143,8 @@ export class ManageAndroid { currentActions = highLevelActions; continue; } else if (chosenAction === AndroidActionType.GoBackToCaller) { - return await this.callingAction.runAsync(ctx); + await this.callingAction.runAsync(ctx); + return; } } diff --git a/packages/eas-cli/src/credentials/manager/ManageIos.ts b/packages/eas-cli/src/credentials/manager/ManageIos.ts index 818685b276..4a5c126093 100644 --- a/packages/eas-cli/src/credentials/manager/ManageIos.ts +++ b/packages/eas-cli/src/credentials/manager/ManageIos.ts @@ -152,7 +152,8 @@ export class ManageIos { currentActions = highLevelActions; continue; } else if (chosenAction === IosActionType.GoBackToCaller) { - return await this.callingAction.runAsync(ctx); + await this.callingAction.runAsync(ctx); + return; } } else if (actionInfo.scope === Scope.Project) { assert( diff --git a/packages/eas-cli/src/credentials/manager/SelectPlatform.ts b/packages/eas-cli/src/credentials/manager/SelectPlatform.ts index 1dfad635c0..e4fe6759a8 100644 --- a/packages/eas-cli/src/credentials/manager/SelectPlatform.ts +++ b/packages/eas-cli/src/credentials/manager/SelectPlatform.ts @@ -23,8 +23,9 @@ export class SelectPlatform { const platform = await selectPlatformAsync(this.flagPlatform); if (platform === 'ios') { - return await new ManageIos(this, process.cwd()).runAsync(); + await new ManageIos(this, process.cwd()).runAsync(); + return; } - return await new ManageAndroid(this, process.cwd()).runAsync(); + await new ManageAndroid(this, process.cwd()).runAsync(); } } diff --git a/packages/eas-cli/src/credentials/manager/SetUpBuildCredentialsCommandAction.ts b/packages/eas-cli/src/credentials/manager/SetUpBuildCredentialsCommandAction.ts index 4358695d93..ce155da495 100644 --- a/packages/eas-cli/src/credentials/manager/SetUpBuildCredentialsCommandAction.ts +++ b/packages/eas-cli/src/credentials/manager/SetUpBuildCredentialsCommandAction.ts @@ -24,12 +24,9 @@ export class SetUpBuildCredentialsCommandAction { async runAsync(): Promise { if (this.platform === Platform.IOS) { - return await new SetUpIosBuildCredentials(this, this.projectDir, this.profileName).runAsync(); + await new SetUpIosBuildCredentials(this, this.projectDir, this.profileName).runAsync(); + return; } - return await new SetUpAndroidBuildCredentials( - this, - this.projectDir, - this.profileName - ).runAsync(); + await new SetUpAndroidBuildCredentials(this, this.projectDir, this.profileName).runAsync(); } } diff --git a/packages/eas-cli/src/devices/actions/create/registrationUrlMethod.ts b/packages/eas-cli/src/devices/actions/create/registrationUrlMethod.ts index d4b4ec8726..421e4fc974 100644 --- a/packages/eas-cli/src/devices/actions/create/registrationUrlMethod.ts +++ b/packages/eas-cli/src/devices/actions/create/registrationUrlMethod.ts @@ -20,9 +20,9 @@ export async function runRegistrationUrlMethodAsync( appleTeam ); Log.newLine(); - qrcodeTerminal.generate(registrationURL, { small: true }, code => - Log.log(`${indentString(code, 2)}\n`) - ); + qrcodeTerminal.generate(registrationURL, { small: true }, code => { + Log.log(`${indentString(code, 2)}\n`); + }); Log.log( 'Open the following link on your iOS devices (or scan the QR code) and follow the instructions to install the development profile:' ); diff --git a/packages/eas-cli/src/devices/queries.ts b/packages/eas-cli/src/devices/queries.ts index f75e8655df..0a54792d99 100644 --- a/packages/eas-cli/src/devices/queries.ts +++ b/packages/eas-cli/src/devices/queries.ts @@ -136,8 +136,9 @@ export async function listAndRenderAppleDevicesOnAppleTeamAsync( }), promptOptions: { title: 'Load more devices?', - renderListItems: devices => - renderPageOfAppleDevices({ devices, appleTeam, paginatedQueryOptions }), + renderListItems: devices => { + renderPageOfAppleDevices({ devices, appleTeam, paginatedQueryOptions }); + }, }, }); } diff --git a/packages/eas-cli/src/easMultiselect.ts b/packages/eas-cli/src/easMultiselect.ts index 1263dc1439..192674944a 100644 --- a/packages/eas-cli/src/easMultiselect.ts +++ b/packages/eas-cli/src/easMultiselect.ts @@ -47,7 +47,11 @@ export const easMultiselect = (args: Question): Promise => { const p = new EasMultiselect(args); const onAbort = toSelected || noop; const onSubmit = toSelected || noop; - p.on('submit', x => res(onSubmit(x))); - p.on('abort', x => rej(onAbort(x))); + p.on('submit', x => { + res(onSubmit(x)); + }); + p.on('abort', x => { + rej(onAbort(x)); + }); }); }; diff --git a/packages/eas-cli/src/metadata/apple/tasks/app-review-detail.ts b/packages/eas-cli/src/metadata/apple/tasks/app-review-detail.ts index a81684a486..c5dcfc0272 100644 --- a/packages/eas-cli/src/metadata/apple/tasks/app-review-detail.ts +++ b/packages/eas-cli/src/metadata/apple/tasks/app-review-detail.ts @@ -29,7 +29,8 @@ export class AppReviewDetailTask extends AppleTask { public async uploadAsync({ config, context }: TaskUploadOptions): Promise { const reviewDetail = config.getReviewDetails(); if (!reviewDetail) { - return Log.log(chalk`{dim - Skipped store review details, not configured}`); + Log.log(chalk`{dim - Skipped store review details, not configured}`); + return; } assert(context.version, `App version not initialized, can't upload store review details`); diff --git a/packages/eas-cli/src/metadata/errors.ts b/packages/eas-cli/src/metadata/errors.ts index 5543ab9581..4ead94887a 100644 --- a/packages/eas-cli/src/metadata/errors.ts +++ b/packages/eas-cli/src/metadata/errors.ts @@ -76,7 +76,8 @@ export function logMetadataValidationError(error: MetadataValidationError): void */ export function handleMetadataError(error: Error): void { if (error instanceof MetadataValidationError) { - return logMetadataValidationError(error); + logMetadataValidationError(error); + return; } if (error instanceof MetadataDownloadError || error instanceof MetadataUploadError) { diff --git a/packages/eas-cli/src/metadata/utils/retry.ts b/packages/eas-cli/src/metadata/utils/retry.ts index 4ee363578a..d9472d346b 100644 --- a/packages/eas-cli/src/metadata/utils/retry.ts +++ b/packages/eas-cli/src/metadata/utils/retry.ts @@ -1,5 +1,5 @@ export async function waitAsync(duration: number): Promise { - return await new Promise(resolve => setTimeout(resolve, duration)); + await new Promise(resolve => setTimeout(resolve, duration)); } type WithRetryOptions = { diff --git a/packages/eas-cli/src/ora.ts b/packages/eas-cli/src/ora.ts index 3d96963cc4..2f143af94d 100644 --- a/packages/eas-cli/src/ora.ts +++ b/packages/eas-cli/src/ora.ts @@ -46,13 +46,21 @@ export function ora(options?: Options | string): Ora { const wrapNativeLogs = (): void => { // eslint-disable-next-line no-console - console.log = (...args: any) => logWrap(logReal, args); + console.log = (...args: any) => { + logWrap(logReal, args); + }; // eslint-disable-next-line no-console - console.info = (...args: any) => logWrap(infoReal, args); + console.info = (...args: any) => { + logWrap(infoReal, args); + }; // eslint-disable-next-line no-console - console.warn = (...args: any) => logWrap(warnReal, args); + console.warn = (...args: any) => { + logWrap(warnReal, args); + }; // eslint-disable-next-line no-console - console.error = (...args: any) => logWrap(errorReal, args); + console.error = (...args: any) => { + logWrap(errorReal, args); + }; }; const resetNativeLogs = (): void => { diff --git a/packages/eas-cli/src/project/publish.ts b/packages/eas-cli/src/project/publish.ts index ca4ea49958..93ccf829d0 100644 --- a/packages/eas-cli/src/project/publish.ts +++ b/packages/eas-cli/src/project/publish.ts @@ -134,7 +134,9 @@ async function calculateFileHashAsync(filePath: string, algorithm: string): Prom return await new Promise((resolve, reject) => { const file = fs.createReadStream(filePath).on('error', reject); const hash = file.pipe(crypto.createHash(algorithm)).on('error', reject); - hash.on('finish', () => resolve(hash.read())); + hash.on('finish', () => { + resolve(hash.read()); + }); }); } @@ -207,7 +209,7 @@ export async function buildBundlesAsync({ // Legacy global Expo CLI if (!shouldUseVersionedExpoCLI(projectDir, exp)) { - return await expoCommandAsync(projectDir, [ + await expoCommandAsync(projectDir, [ 'export', '--output-dir', inputDir, @@ -218,6 +220,7 @@ export async function buildBundlesAsync({ `--platform=${platformFlag}`, ...(clearCache ? ['--clear'] : []), ]); + return; } // Versioned Expo CLI, with multiple platform flag support @@ -228,7 +231,7 @@ export async function buildBundlesAsync({ ? ['--platform', 'ios', '--platform', 'android'] : ['--platform', platformFlag]; - return await expoCommandAsync(projectDir, [ + await expoCommandAsync(projectDir, [ 'export', '--output-dir', inputDir, @@ -237,6 +240,7 @@ export async function buildBundlesAsync({ ...platformArgs, ...(clearCache ? ['--clear'] : []), ]); + return; } // Versioned Expo CLI, without multiple platform flag support @@ -249,7 +253,7 @@ export async function buildBundlesAsync({ ); } - return await expoCommandAsync(projectDir, [ + await expoCommandAsync(projectDir, [ 'export', '--output-dir', inputDir, diff --git a/packages/eas-cli/src/rollout/__tests__/branch-mapping-test.ts b/packages/eas-cli/src/rollout/__tests__/branch-mapping-test.ts index b2f3e21313..e3bd30a695 100644 --- a/packages/eas-cli/src/rollout/__tests__/branch-mapping-test.ts +++ b/packages/eas-cli/src/rollout/__tests__/branch-mapping-test.ts @@ -100,15 +100,15 @@ describe(createRolloutBranchMapping, () => { describe(assertRolloutBranchMapping, () => { it('asserts a rollout branch mapping', () => { - expect(() => assertRolloutBranchMapping(standardBranchMapping)).toThrowError( - BranchMappingValidationError - ); - expect(() => assertRolloutBranchMapping(rolloutBranchMapping)).not.toThrowError( - BranchMappingValidationError - ); - expect(() => assertRolloutBranchMapping(rolloutBranchMappingLegacy)).not.toThrowError( - BranchMappingValidationError - ); + expect(() => { + assertRolloutBranchMapping(standardBranchMapping); + }).toThrowError(BranchMappingValidationError); + expect(() => { + assertRolloutBranchMapping(rolloutBranchMapping); + }).not.toThrowError(BranchMappingValidationError); + expect(() => { + assertRolloutBranchMapping(rolloutBranchMappingLegacy); + }).not.toThrowError(BranchMappingValidationError); }); }); diff --git a/packages/eas-cli/src/update/queries.ts b/packages/eas-cli/src/update/queries.ts index fe981996d1..f9fd0319d0 100644 --- a/packages/eas-cli/src/update/queries.ts +++ b/packages/eas-cli/src/update/queries.ts @@ -51,8 +51,9 @@ export async function listAndRenderUpdateGroupsOnAppAsync( queryUpdateGroupsOnAppAsync(graphqlClient, { limit, offset, appId: projectId }), promptOptions: { title: 'Load more update groups?', - renderListItems: updateGroups => - renderUpdateGroupsOnApp({ updateGroups, paginatedQueryOptions }), + renderListItems: updateGroups => { + renderUpdateGroupsOnApp({ updateGroups, paginatedQueryOptions }); + }, }, }); } @@ -91,8 +92,9 @@ export async function listAndRenderUpdateGroupsOnBranchAsync( }), promptOptions: { title: 'Load more update groups?', - renderListItems: updateGroups => - renderUpdateGroupsOnBranch({ updateGroups, branchName, paginatedQueryOptions }), + renderListItems: updateGroups => { + renderUpdateGroupsOnBranch({ updateGroups, branchName, paginatedQueryOptions }); + }, }, }); } @@ -179,7 +181,8 @@ function renderUpdateGroupsOnBranch({ }; if (json) { - return printJsonOnlyOutput({ ...branch, currentPage: updateGroupDescriptions }); + printJsonOnlyOutput({ ...branch, currentPage: updateGroupDescriptions }); + return; } Log.addNewLineIfNone(); diff --git a/packages/eas-cli/src/update/republish.ts b/packages/eas-cli/src/update/republish.ts index 21e963b29e..b7f1bac137 100644 --- a/packages/eas-cli/src/update/republish.ts +++ b/packages/eas-cli/src/update/republish.ts @@ -167,7 +167,8 @@ export async function republishAsync({ } if (json) { - return printJsonOnlyOutput(updatesRepublished); + printJsonOnlyOutput(updatesRepublished); + return; } const updatesRepublishedByPlatform = Object.fromEntries( diff --git a/packages/eas-cli/src/utils/__tests__/code-signing-test.ts b/packages/eas-cli/src/utils/__tests__/code-signing-test.ts index 10568b6ed5..9a2c194783 100644 --- a/packages/eas-cli/src/utils/__tests__/code-signing-test.ts +++ b/packages/eas-cli/src/utils/__tests__/code-signing-test.ts @@ -149,9 +149,9 @@ describe(checkManifestBodyAgainstUpdateInfoGroup, () => { }, ], }; - expect(() => - checkManifestBodyAgainstUpdateInfoGroup(manifestResponseBodyJSON, partialManifest) - ).not.toThrow(); + expect(() => { + checkManifestBodyAgainstUpdateInfoGroup(manifestResponseBodyJSON, partialManifest); + }).not.toThrow(); }); it('throws when extra.expoClient is tampered with', () => { @@ -187,9 +187,9 @@ describe(checkManifestBodyAgainstUpdateInfoGroup, () => { }, assets: [], }; - expect(() => - checkManifestBodyAgainstUpdateInfoGroup(manifestResponseBodyJSON, partialManifest) - ).toThrow( + expect(() => { + checkManifestBodyAgainstUpdateInfoGroup(manifestResponseBodyJSON, partialManifest); + }).toThrow( `Code signing manifest integrity error: The manifest being signed contains an extra.expoClient field that does not match the initially uploaded manifest's extra.expoClient field` ); }); @@ -228,9 +228,9 @@ describe(checkManifestBodyAgainstUpdateInfoGroup, () => { }, assets: [], }; - expect(() => - checkManifestBodyAgainstUpdateInfoGroup(manifestResponseBodyJSON, partialManifest) - ).toThrow( + expect(() => { + checkManifestBodyAgainstUpdateInfoGroup(manifestResponseBodyJSON, partialManifest); + }).toThrow( 'Code signing manifest integrity error: The manifest being signed has an assets array of differing length from the initially uploaded manifest' ); }); @@ -276,9 +276,9 @@ describe(checkManifestBodyAgainstUpdateInfoGroup, () => { }, ], }; - expect(() => - checkManifestBodyAgainstUpdateInfoGroup(manifestResponseBodyJSON, partialManifest) - ).toThrow( + expect(() => { + checkManifestBodyAgainstUpdateInfoGroup(manifestResponseBodyJSON, partialManifest); + }).toThrow( 'Code signing manifest integrity error: The manifest being signed has is missing an asset specified in the initially uploaded manifest: 3' ); }); @@ -324,9 +324,9 @@ describe(checkManifestBodyAgainstUpdateInfoGroup, () => { }, ], }; - expect(() => - checkManifestBodyAgainstUpdateInfoGroup(manifestResponseBodyJSON, partialManifest) - ).toThrow( + expect(() => { + checkManifestBodyAgainstUpdateInfoGroup(manifestResponseBodyJSON, partialManifest); + }).toThrow( 'Code signing manifest integrity error: Manifest asset tamper detected for asset: 2; field: contentType' ); }); diff --git a/packages/eas-cli/src/utils/image.ts b/packages/eas-cli/src/utils/image.ts index 7db2fce320..f64d23479f 100644 --- a/packages/eas-cli/src/utils/image.ts +++ b/packages/eas-cli/src/utils/image.ts @@ -11,7 +11,7 @@ export async function ensurePNGIsNotTransparentAsync(imagePathOrURL: string): Pr const stream = await getImageStreamAsync(imagePathOrURL); let metadata: Metadata | undefined; - return await new Promise((res, rej) => { + await new Promise((res, rej) => { stream .pipe(new PNG({ filterType: 4 })) .on('error', err => { diff --git a/packages/eas-cli/src/utils/promise.ts b/packages/eas-cli/src/utils/promise.ts index 51c4e5405d..5cb6dc4bc1 100644 --- a/packages/eas-cli/src/utils/promise.ts +++ b/packages/eas-cli/src/utils/promise.ts @@ -5,5 +5,5 @@ * @returns A promise that resolves after the provided number of milliseconds. */ export async function sleepAsync(ms: number): Promise { - return await new Promise(res => setTimeout(res, ms)); + await new Promise(res => setTimeout(res, ms)); } diff --git a/packages/eas-cli/src/utils/queries.ts b/packages/eas-cli/src/utils/queries.ts index ada38b9965..dfb05914bb 100644 --- a/packages/eas-cli/src/utils/queries.ts +++ b/packages/eas-cli/src/utils/queries.ts @@ -36,7 +36,7 @@ type PaginatedQueryWithSelectPromptArgs, >(queryArgs: PaginatedQueryWithConfirmPromptArgs): Promise { - return await paginatedQueryWithConfirmPromptInternalAsync(queryArgs, []); + await paginatedQueryWithConfirmPromptInternalAsync(queryArgs, []); } async function paginatedQueryWithConfirmPromptInternalAsync< @@ -64,7 +64,7 @@ async function paginatedQueryWithConfirmPromptInternalAsync< } if (await confirmAsync({ message: promptOptions.title })) { - return await paginatedQueryWithConfirmPromptInternalAsync( + await paginatedQueryWithConfirmPromptInternalAsync( { limit, offset: offset + limit,