diff --git a/packages/android-jsc-intl/src/withAndroidJscIntl.ts b/packages/android-jsc-intl/src/withAndroidJscIntl.ts index 23f65f24..a668e4c7 100644 --- a/packages/android-jsc-intl/src/withAndroidJscIntl.ts +++ b/packages/android-jsc-intl/src/withAndroidJscIntl.ts @@ -10,13 +10,13 @@ const withAndroidJscIntl: ConfigPlugin = (config) => { return withAppBuildGradle(config, (config) => { if (config.modResults.language !== "groovy") { throw new Error( - "[@expo/config-plugins][withAndroidJscIntl] Cannot enable Intl in Android JSC app gradle because the build.gradle is not groovy." + "[@expo/config-plugins][withAndroidJscIntl] Cannot enable Intl in Android JSC app gradle because the build.gradle is not groovy.", ); } config.modResults.contents = config.modResults.contents.replace( "org.webkit:android-jsc:+", - "org.webkit:android-jsc-intl:+" + "org.webkit:android-jsc-intl:+", ); return config; diff --git a/packages/apple-settings/src/base-mods/strings.ts b/packages/apple-settings/src/base-mods/strings.ts index e0839f08..d95a6099 100644 --- a/packages/apple-settings/src/base-mods/strings.ts +++ b/packages/apple-settings/src/base-mods/strings.ts @@ -11,7 +11,7 @@ export function parse(data: string, wantComments?: boolean): ParsedStrings { if (data.indexOf("\n") === -1) { data += "\n"; } - const re = /(?:\/\*(.+)\*\/\n)?(.+)\s*\=\s*\"(.+)\"\;\n/gim; + const re = /(?:\/\*(.+)\*\/\n)?(.+)\s*=\s*"(.+)";\n/gim; const res: ParsedStrings = {}; let m: RegExpExecArray | null; @@ -44,7 +44,7 @@ export function build(obj: ParsedStrings): string { data += "\n/*" + obj[i]["comment"] + "*/\n"; } // @ts-expect-error - data += '"' + i + '" = ' + '"' + escapeString(obj[i]["value"]) + '";\n'; + data += '"' + i + '" = "' + escapeString(obj[i]["value"]) + '";\n'; } else if (typeof obj[i] === "string") { data += '\n"' + @@ -53,7 +53,7 @@ export function build(obj: ParsedStrings): string { '"' + escapeString( // @ts-expect-error - obj[i] + obj[i], ) + '";\n'; } @@ -78,6 +78,6 @@ export function writeAsync(filename: string, data: ParsedStrings) { return fs.promises.writeFile( filename, iconv.encode(build(data), "utf-16"), - "binary" + "binary", ); } diff --git a/packages/apple-settings/src/base-mods/withSettingsPlist.ts b/packages/apple-settings/src/base-mods/withSettingsPlist.ts index eb5855ba..d6a81aad 100644 --- a/packages/apple-settings/src/base-mods/withSettingsPlist.ts +++ b/packages/apple-settings/src/base-mods/withSettingsPlist.ts @@ -18,7 +18,7 @@ export function createModSetForSettingsPage({ name }: { name: string }) { const withSettingsPlist: ConfigPlugin> = ( config, - action + action, ) => { return withMod(config, { platform: "ios", @@ -40,7 +40,7 @@ export function createModSetForSettingsPage({ name }: { name: string }) { return path.join( modRequest.platformProjectRoot, modRequest.projectName!, - `Settings.bundle/${name}.plist` + `Settings.bundle/${name}.plist`, ); }, async read(filePath) { @@ -51,11 +51,11 @@ export function createModSetForSettingsPage({ name }: { name: string }) { }; } return plist.default.parse( - await fs.promises.readFile(filePath, "utf-8") + await fs.promises.readFile(filePath, "utf-8"), ); } catch (error: any) { throw new Error( - `Failed to parse the iOS Settings.bundle/${name}.plist: "${filePath}". ${error.message}}` + `Failed to parse the iOS Settings.bundle/${name}.plist: "${filePath}". ${error.message}}`, ); } }, diff --git a/packages/apple-settings/src/base-mods/withSettingsStrings.ts b/packages/apple-settings/src/base-mods/withSettingsStrings.ts index 528a86f1..273efdbf 100644 --- a/packages/apple-settings/src/base-mods/withSettingsStrings.ts +++ b/packages/apple-settings/src/base-mods/withSettingsStrings.ts @@ -35,7 +35,7 @@ export function createModSetForSettingsStrings({ return path.join( modRequest.platformProjectRoot, modRequest.projectName!, - `Settings.bundle/${lang}.lproj/${name}.strings` + `Settings.bundle/${lang}.lproj/${name}.strings`, ); }, async read(filePath) { @@ -49,7 +49,7 @@ export function createModSetForSettingsStrings({ >; } catch (error: any) { throw new Error( - `Failed to parse the Settings.bundle/${lang}.lproj/${name}.strings: "${filePath}". ${error.message}}` + `Failed to parse the Settings.bundle/${lang}.lproj/${name}.strings: "${filePath}". ${error.message}}`, ); } }, diff --git a/packages/apple-settings/src/base-mods/withXcparse.ts b/packages/apple-settings/src/base-mods/withXcparse.ts index 66e7f072..de1fe881 100644 --- a/packages/apple-settings/src/base-mods/withXcparse.ts +++ b/packages/apple-settings/src/base-mods/withXcparse.ts @@ -14,7 +14,7 @@ const customModName = "xcodeProjectBeta-apple-settings"; export const withXcodeProjectBeta: ConfigPlugin> = ( config, - action + action, ) => { return withMod(config, { platform: "ios", @@ -41,7 +41,7 @@ const withXcodeProjectBetaBaseModInternal: ConfigPlugin = (config) => { return XcodeProject.open(filePath); } catch (error: any) { throw new Error( - `Failed to parse the Xcode project: "${filePath}". ${error.message}}` + `Failed to parse the Xcode project: "${filePath}". ${error.message}}`, ); } }, @@ -61,5 +61,5 @@ const withXcodeProjectBetaBaseModInternal: ConfigPlugin = (config) => { export const withXcodeProjectBetaBaseMod = createRunOncePlugin( withXcodeProjectBetaBaseModInternal, - "withXcodeProjectBetaBaseMod" + "withXcodeProjectBetaBaseMod", ); diff --git a/packages/apple-settings/src/withLinkedSettingsBundle.ts b/packages/apple-settings/src/withLinkedSettingsBundle.ts index 65c71ce9..2edb3777 100644 --- a/packages/apple-settings/src/withLinkedSettingsBundle.ts +++ b/packages/apple-settings/src/withLinkedSettingsBundle.ts @@ -28,7 +28,7 @@ function getMainAppTarget(project: XcodeProject): PBXNativeTarget { console.warn( `Multiple main app targets found, using first one: ${mainAppTarget .map((t) => t.getDisplayName()) - .join(", ")}}` + .join(", ")}}`, ); } @@ -39,7 +39,7 @@ function getDefaultBuildConfigurationForTarget(target: PBXNativeTarget) { return target.props.buildConfigurationList.props.buildConfigurations.find( (config) => config.props.name === - target.props.buildConfigurationList.props.defaultConfigurationName + target.props.buildConfigurationList.props.defaultConfigurationName, ); } @@ -54,17 +54,17 @@ export const withLinkedSettingsBundle: ConfigPlugin = (config) => { async function applyXcodeChanges( project: XcodeProject, - props: { projectName: string } + props: { projectName: string }, ) { const mainAppTarget = getMainAppTarget(project); const mainResourceBuildPhase = mainAppTarget.getBuildPhase( - PBXResourcesBuildPhase + PBXResourcesBuildPhase, ); // Prevent duplicate. if ( mainResourceBuildPhase?.props.files.find( - (file) => file.props.fileRef.props.name === "Settings.bundle" + (file) => file.props.fileRef.props.name === "Settings.bundle", ) ) { return project; diff --git a/packages/detox/src/__tests__/withDetoxTestAppGradle.test.ts b/packages/detox/src/__tests__/withDetoxTestAppGradle.test.ts index c91ac303..1c55b99a 100644 --- a/packages/detox/src/__tests__/withDetoxTestAppGradle.test.ts +++ b/packages/detox/src/__tests__/withDetoxTestAppGradle.test.ts @@ -4,11 +4,11 @@ import { setGradleAndroidTestImplementation } from "../withDetoxTestAppGradle"; describe(setGradleAndroidTestImplementation, () => { it(`appends`, () => { const result = setGradleAndroidTestImplementation( - getFixture("app-build.gradle") + getFixture("app-build.gradle"), ); expect(result).toContain("androidTestImplementation('com.wix:detox:+')"); expect(result).toContain( - "implementation 'androidx.appcompat:appcompat:1.6.1'" + "implementation 'androidx.appcompat:appcompat:1.6.1'", ); expect(result).toMatchSnapshot(); }); diff --git a/packages/detox/src/__tests__/withProguardGradle-test.ts b/packages/detox/src/__tests__/withProguardGradle-test.ts index 84242f3d..6efcafa8 100644 --- a/packages/detox/src/__tests__/withProguardGradle-test.ts +++ b/packages/detox/src/__tests__/withProguardGradle-test.ts @@ -46,7 +46,7 @@ describe(addDetoxProguardRules, () => { }); it(`doesn't add proguard rules to gradle if proguard is missing from the template`, () => { expect( - addDetoxProguardRules(buildGradleWithoutProguardFixture) + addDetoxProguardRules(buildGradleWithoutProguardFixture), ).not.toMatch(/detox/); }); it(`doesn't duplicate`, () => { diff --git a/packages/detox/src/withDetox.ts b/packages/detox/src/withDetox.ts index e71443ae..a44eb15d 100644 --- a/packages/detox/src/withDetox.ts +++ b/packages/detox/src/withDetox.ts @@ -52,7 +52,7 @@ const withDetox: ConfigPlugin< [withNetworkSecurityConfigManifest, { subdomains }], // 7. !skipProguard && withProguardGradle, - ].filter(Boolean) as ([ConfigPlugin, any] | ConfigPlugin)[] + ].filter(Boolean) as ([ConfigPlugin, any] | ConfigPlugin)[], ); }; diff --git a/packages/detox/src/withDetoxProjectGradle.ts b/packages/detox/src/withDetoxProjectGradle.ts index e616fa60..5c6f972a 100644 --- a/packages/detox/src/withDetoxProjectGradle.ts +++ b/packages/detox/src/withDetoxProjectGradle.ts @@ -21,11 +21,11 @@ const withDetoxProjectGradle: ConfigPlugin = (config) => { return withProjectBuildGradle(config, (config) => { if (config.modResults.language === "groovy") { config.modResults.contents = addDetoxImport( - config.modResults.contents + config.modResults.contents, ).contents; } else { throw new Error( - "Cannot add Detox maven gradle because the project build.gradle is not groovy" + "Cannot add Detox maven gradle because the project build.gradle is not groovy", ); } return config; diff --git a/packages/detox/src/withDetoxTestAppGradle.ts b/packages/detox/src/withDetoxTestAppGradle.ts index b93f95c2..61f14cfa 100644 --- a/packages/detox/src/withDetoxTestAppGradle.ts +++ b/packages/detox/src/withDetoxTestAppGradle.ts @@ -11,14 +11,14 @@ const withDetoxTestAppGradle: ConfigPlugin = (config) => { return withAppBuildGradle(config, (config) => { if (config.modResults.language === "groovy") { config.modResults.contents = setGradleAndroidTestImplementation( - config.modResults.contents + config.modResults.contents, ); config.modResults.contents = addDetoxDefaultConfigBlock( - config.modResults.contents + config.modResults.contents, ); } else { throw new Error( - "Cannot add Detox maven gradle because the project build.gradle is not groovy" + "Cannot add Detox maven gradle because the project build.gradle is not groovy", ); } return config; @@ -26,16 +26,16 @@ const withDetoxTestAppGradle: ConfigPlugin = (config) => { }; export function setGradleAndroidTestImplementation( - buildGradle: string + buildGradle: string, ): string { buildGradle = pushGradleDependency( buildGradle, // SDK 50 https://github.com/wix/Detox/blob/700b750e8a09b2eff2d26c0dbf3c50b70130fc9b/examples/demo-react-native/android/app/build.gradle#L61 - "implementation 'androidx.appcompat:appcompat:1.6.1'" + "implementation 'androidx.appcompat:appcompat:1.6.1'", ); buildGradle = pushGradleDependency( buildGradle, - "androidTestImplementation('com.wix:detox:+')" + "androidTestImplementation('com.wix:detox:+')", ); return buildGradle; } @@ -46,7 +46,7 @@ function escapeStringRegexp(str: string) { export function pushGradleDependency( buildGradle: string, - dependency: string + dependency: string, ): string { const pattern = new RegExp(escapeStringRegexp(dependency), "g"); if (buildGradle.match(pattern)) { @@ -55,7 +55,7 @@ export function pushGradleDependency( return buildGradle.replace( /dependencies\s?{/, `dependencies { - ${dependency}` + ${dependency}`, ); } @@ -70,7 +70,7 @@ export function addDetoxDefaultConfigBlock(buildGradle: string): string { `defaultConfig { // detox-plugin-default-config testBuildType System.getProperty('testBuildType', 'debug') - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'` + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'`, ); } diff --git a/packages/detox/src/withDetoxTestClass.ts b/packages/detox/src/withDetoxTestClass.ts index fa7579d2..399031b8 100644 --- a/packages/detox/src/withDetoxTestClass.ts +++ b/packages/detox/src/withDetoxTestClass.ts @@ -56,13 +56,13 @@ export const withDetoxTestClass: ConfigPlugin = (config) => { assert(packageName, "android.package must be defined"); const folder = path.join( config.modRequest.platformProjectRoot, - `app/src/androidTest/java/${packageName.split(".").join("/")}` + `app/src/androidTest/java/${packageName.split(".").join("/")}`, ); fs.mkdirSync(folder, { recursive: true }); fs.writeFileSync( path.join(folder, "DetoxTest.java"), getTemplateFile(packageName), - { encoding: "utf8" } + { encoding: "utf8" }, ); return config; }, diff --git a/packages/detox/src/withKotlinGradle.ts b/packages/detox/src/withKotlinGradle.ts index 95bd3afc..3511626a 100644 --- a/packages/detox/src/withKotlinGradle.ts +++ b/packages/detox/src/withKotlinGradle.ts @@ -1,5 +1,5 @@ -import { withBuildProperties } from "expo-build-properties"; import { ConfigPlugin, withProjectBuildGradle } from "expo/config-plugins"; +import { withBuildProperties } from "expo-build-properties"; const kotlinClassPath = "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"; @@ -21,11 +21,11 @@ const withKotlinGradle: ConfigPlugin = (config, version) => { // Add the classpath to the project build.gradle if (config.modResults.language === "groovy") { config.modResults.contents = setKotlinClassPath( - config.modResults.contents + config.modResults.contents, ); } else { throw new Error( - "Cannot setup kotlin because the build.gradle is not groovy" + "Cannot setup kotlin because the build.gradle is not groovy", ); } return config; @@ -40,7 +40,7 @@ function setKotlinClassPath(buildGradle: string): string { return buildGradle.replace( /dependencies\s?{/, `dependencies { - classpath "${kotlinClassPath}"` + classpath "${kotlinClassPath}"`, ); } diff --git a/packages/detox/src/withNetworkSecurityConfig.ts b/packages/detox/src/withNetworkSecurityConfig.ts index 309c2f71..2750e695 100644 --- a/packages/detox/src/withNetworkSecurityConfig.ts +++ b/packages/detox/src/withNetworkSecurityConfig.ts @@ -20,7 +20,7 @@ function getTemplateConfigContent(subdomains: SubdomainsType) { ${subdomains .map( (subdomain) => - `${subdomain}` + `${subdomain}`, ) .join("")} @@ -53,13 +53,13 @@ const withNetworkSecurityConfigFile: ConfigPlugin<{ assert(packageName, "android.package must be defined"); const folder = path.join( config.modRequest.platformProjectRoot, - `app/src/main/res/xml` + `app/src/main/res/xml`, ); fs.mkdirSync(folder, { recursive: true }); fs.writeFileSync( path.join(folder, "network_security_config.xml"), getTemplateFile(subdomains), - { encoding: "utf8" } + { encoding: "utf8" }, ); return config; }, @@ -88,7 +88,7 @@ export const withNetworkSecurityConfigManifest: ConfigPlugin< config = withNetworkSecurityConfigFile(config, props); return withAndroidManifest(config, (config) => { const application = AndroidConfig.Manifest.getMainApplicationOrThrow( - config.modResults + config.modResults, ); application.$["android:networkSecurityConfig"] = "@xml/network_security_config"; diff --git a/packages/detox/src/withProguardGradle.ts b/packages/detox/src/withProguardGradle.ts index 3b606d29..20768ca2 100644 --- a/packages/detox/src/withProguardGradle.ts +++ b/packages/detox/src/withProguardGradle.ts @@ -11,11 +11,11 @@ const withProguardGradle: ConfigPlugin = (config) => { return withAppBuildGradle(config, (config) => { if (config.modResults.language === "groovy") { config.modResults.contents = addDetoxProguardRules( - config.modResults.contents + config.modResults.contents, ); } else { throw new Error( - "Cannot add Detox maven gradle because the project build.gradle is not groovy" + "Cannot add Detox maven gradle because the project build.gradle is not groovy", ); } return config; @@ -34,7 +34,7 @@ export function addDetoxProguardRules(buildGradle: string): string { // Detox-specific additions to pro-guard def detoxProguardRulesPath = new File(["node", "--print", "require.resolve('detox/package.json')"].execute(null, rootDir).text.trim(), "../android/detox/proguard-rules-app.pro") proguardFile(detoxProguardRulesPath) - ` + `, ); } diff --git a/packages/ffmpeg-kit-react-native/src/__tests__/withAndroidFFMPEGPackage-test.ts b/packages/ffmpeg-kit-react-native/src/__tests__/withAndroidFFMPEGPackage-test.ts index b83f638c..d90644c2 100644 --- a/packages/ffmpeg-kit-react-native/src/__tests__/withAndroidFFMPEGPackage-test.ts +++ b/packages/ffmpeg-kit-react-native/src/__tests__/withAndroidFFMPEGPackage-test.ts @@ -4,7 +4,7 @@ import { addPackageName } from "../withAndroidFFMPEGPackage"; describe(addPackageName, () => { it(`adds undefined package`, () => { expect( - addPackageName(getFixture("build.gradle"), undefined) + addPackageName(getFixture("build.gradle"), undefined), ).toMatchSnapshot(); }); it(`redefines the package`, () => { diff --git a/packages/ffmpeg-kit-react-native/src/withAndroidFFMPEGPackage.ts b/packages/ffmpeg-kit-react-native/src/withAndroidFFMPEGPackage.ts index 927fc041..f14d9a65 100644 --- a/packages/ffmpeg-kit-react-native/src/withAndroidFFMPEGPackage.ts +++ b/packages/ffmpeg-kit-react-native/src/withAndroidFFMPEGPackage.ts @@ -12,17 +12,17 @@ import { export const withAndroidFFMPEGPackage: ConfigPlugin = ( config, - packageName + packageName, ) => { config = withProjectBuildGradle(config, (config) => { if (config.modResults.language === "groovy") { config.modResults.contents = addPackageName( config.modResults.contents, - packageName + packageName, ); } else { throw new Error( - "Cannot add camera maven gradle because the build.gradle is not groovy" + "Cannot add camera maven gradle because the build.gradle is not groovy", ); } return config; diff --git a/packages/ffmpeg-kit-react-native/src/withCocoaPodsImport.ts b/packages/ffmpeg-kit-react-native/src/withCocoaPodsImport.ts index 7e231b98..79e5bbb2 100644 --- a/packages/ffmpeg-kit-react-native/src/withCocoaPodsImport.ts +++ b/packages/ffmpeg-kit-react-native/src/withCocoaPodsImport.ts @@ -9,7 +9,7 @@ import path from "path"; export const withPodfilePropertiesPackage: ConfigPlugin = ( config, - packageName + packageName, ) => { return withPodfileProperties(config, (config) => { // @ts-ignore: wrong type diff --git a/packages/ffmpeg-kit-react-native/src/withFFMPEG.ts b/packages/ffmpeg-kit-react-native/src/withFFMPEG.ts index 0434d588..c9d1f90e 100644 --- a/packages/ffmpeg-kit-react-native/src/withFFMPEG.ts +++ b/packages/ffmpeg-kit-react-native/src/withFFMPEG.ts @@ -1,9 +1,9 @@ -import { withBuildProperties } from "expo-build-properties"; import { ConfigPlugin, createRunOncePlugin, withPlugins, } from "expo/config-plugins"; +import { withBuildProperties } from "expo-build-properties"; import { withAndroidFFMPEGPackage } from "./withAndroidFFMPEGPackage"; import { diff --git a/packages/ffmpeg-kit-react-native/src/withIosDeploymentTarget.ts b/packages/ffmpeg-kit-react-native/src/withIosDeploymentTarget.ts index c24da565..47ba1104 100644 --- a/packages/ffmpeg-kit-react-native/src/withIosDeploymentTarget.ts +++ b/packages/ffmpeg-kit-react-native/src/withIosDeploymentTarget.ts @@ -13,7 +13,7 @@ type IosDeploymentTargetConfigPlugin = ConfigPlugin<{ export const withIosDeploymentTarget: IosDeploymentTargetConfigPlugin = ( config, - props + props, ) => { config = withIosDeploymentTargetPodfile(config, props); config = withIosDeploymentTargetXcodeProject(config, props); @@ -22,7 +22,7 @@ export const withIosDeploymentTarget: IosDeploymentTargetConfigPlugin = ( const withIosDeploymentTargetPodfile: IosDeploymentTargetConfigPlugin = ( config, - props + props, ) => { return withPodfileProperties(config, async (config) => { const existing = config.modResults["ios.deploymentTarget"]; @@ -38,12 +38,12 @@ const withIosDeploymentTargetPodfile: IosDeploymentTargetConfigPlugin = ( const withIosDeploymentTargetXcodeProject: IosDeploymentTargetConfigPlugin = ( config, - props + props, ) => { return withXcodeProject(config, (config) => { config.modResults = updateDeploymentTargetXcodeProject( config.modResults, - props.deploymentTarget + props.deploymentTarget, ); return config; }); @@ -51,7 +51,7 @@ const withIosDeploymentTargetXcodeProject: IosDeploymentTargetConfigPlugin = ( export function updateDeploymentTargetXcodeProject( project: XcodeProject, - deploymentTarget: string + deploymentTarget: string, ): XcodeProject { const configurations = project.pbxXCBuildConfigurationSection(); // @ts-ignore diff --git a/packages/ios-stickers/src/__tests__/generateImessageIconsAsync.test.ts b/packages/ios-stickers/src/__tests__/generateImessageIconsAsync.test.ts index 057a0f40..91681fd3 100644 --- a/packages/ios-stickers/src/__tests__/generateImessageIconsAsync.test.ts +++ b/packages/ios-stickers/src/__tests__/generateImessageIconsAsync.test.ts @@ -12,12 +12,12 @@ describe(generateImessageIconsAsync, () => { vol.fromJSON({}, "/"); await fs.promises.writeFile( "/icon.png", - await fsReal.promises.readFile(path.join(__dirname, "fixtures/icon.png")) + await fsReal.promises.readFile(path.join(__dirname, "fixtures/icon.png")), ); const contents = await generateImessageIconsAsync( "/", "/icon.png", - "/output" + "/output", ); expect(generateImageAsync).toHaveBeenCalledTimes(13); diff --git a/packages/ios-stickers/src/__tests__/withStickerPack-test.ts b/packages/ios-stickers/src/__tests__/withStickerPack-test.ts index 1834c982..faded5cc 100644 --- a/packages/ios-stickers/src/__tests__/withStickerPack-test.ts +++ b/packages/ios-stickers/src/__tests__/withStickerPack-test.ts @@ -10,7 +10,7 @@ describe(withStickerPack, () => { stickers: [{ image: "test.png" }], columns: 2, icon: "test.png", - }) + }), ).not.toThrow(); }); it("should not throw when no options are provided", () => { diff --git a/packages/ios-stickers/src/generateImessageIconsAsync.ts b/packages/ios-stickers/src/generateImessageIconsAsync.ts index 79d6de71..ca8124bc 100644 --- a/packages/ios-stickers/src/generateImessageIconsAsync.ts +++ b/packages/ios-stickers/src/generateImessageIconsAsync.ts @@ -101,7 +101,7 @@ const ICON_CONTENTS: { export async function generateImessageIconsAsync( projectRoot: string, icon: string, - iconsPath: string + iconsPath: string, ): Promise { // Ensure the Images.xcassets/AppIcon.appiconset path exists fs.mkdirSync(iconsPath, { recursive: true }); @@ -139,7 +139,7 @@ export async function generateImessageIconsAsync( // Force the background color to solid white to prevent any transparency. // TODO: Maybe use a more adaptive option based on the icon color? backgroundColor: "#ffffff", - } + }, ); // Write image buffer to the file system. const assetPath = join(iconsPath, filename); @@ -168,7 +168,7 @@ export async function generateImessageIconsAsync( function getAppleIconName( size: number | [number, number], scale: number, - idiom: string + idiom: string, ) { const [width, height] = Array.isArray(size) ? size : [size, size]; return `App-Icon-${idiom}-${width}x${height}@${scale}x.png`; diff --git a/packages/ios-stickers/src/withStickerAssets.ts b/packages/ios-stickers/src/withStickerAssets.ts index 10249373..6a6e8c2a 100644 --- a/packages/ios-stickers/src/withStickerAssets.ts +++ b/packages/ios-stickers/src/withStickerAssets.ts @@ -83,12 +83,12 @@ export const withStickerAssets: ConfigPlugin<{ "ios", async (config) => { const stickerPackName = getProjectStickersName( - config.modRequest.projectName! + config.modRequest.projectName!, ); const stickerRootPath = path.join( config.modRequest.platformProjectRoot, - stickerPackName + stickerPackName, ); const stickersAssetsPath = path.join(stickerRootPath, STICKERS_ROOT_PATH); @@ -100,7 +100,7 @@ export const withStickerAssets: ConfigPlugin<{ const stickersRootContentsJsonPath = path.join( stickersAssetsPath, - "Contents.json" + "Contents.json", ); fs.mkdirSync(stickersAssetsPath, { recursive: true, @@ -108,26 +108,26 @@ export const withStickerAssets: ConfigPlugin<{ // Xcode has trouble with the Contents.json for marketing images fs.writeFileSync( stickersRootContentsJsonPath, - JSON.stringify(stickersRootContents, null, 2) + JSON.stringify(stickersRootContents, null, 2), ); // iMessage icon const iMessageAppIconsPath = path.join( stickerRootPath, - IMESSAGE_APP_ICON_PATH + IMESSAGE_APP_ICON_PATH, ); // Only generate icons if an icon is defined const imessageIconContents = icon ? await generateImessageIconsAsync( config.modRequest.projectRoot, icon, - iMessageAppIconsPath + iMessageAppIconsPath, ) : []; const iMessageAppIconContentsJsonPath = path.join( iMessageAppIconsPath, - "Contents.json" + "Contents.json", ); fs.mkdirSync(iMessageAppIconsPath, { recursive: true, @@ -138,13 +138,13 @@ export const withStickerAssets: ConfigPlugin<{ JSON.stringify( { images: imessageIconContents, info: defaultInfo }, null, - 2 - ) + 2, + ), ); const stickerPackContentsPath = path.join( stickerRootPath, - STICKER_PACK_PATH + STICKER_PACK_PATH, ); const stickersContents: { @@ -175,7 +175,7 @@ export const withStickerAssets: ConfigPlugin<{ }, { src, - } as any + } as any, ); // let results; @@ -195,7 +195,7 @@ export const withStickerAssets: ConfigPlugin<{ const stickerPackContentsJsonPath = path.join( stickerPackContentsPath, - "Contents.json" + "Contents.json", ); fs.mkdirSync(stickerPackContentsPath, { recursive: true, @@ -203,7 +203,7 @@ export const withStickerAssets: ConfigPlugin<{ // TODO fs.writeFileSync( stickerPackContentsJsonPath, - JSON.stringify(stickersContents, null, 2) + JSON.stringify(stickersContents, null, 2), ); return config; diff --git a/packages/ios-stickers/src/withStickerInfoPlist.ts b/packages/ios-stickers/src/withStickerInfoPlist.ts index 83b9746e..25a11e5f 100644 --- a/packages/ios-stickers/src/withStickerInfoPlist.ts +++ b/packages/ios-stickers/src/withStickerInfoPlist.ts @@ -13,17 +13,17 @@ import { getProjectStickersName } from "./withStickerXcodeTarget"; export const withStickersPlist: ConfigPlugin> = ( config, - { name } + { name }, ) => { return withDangerousMod(config, [ "ios", async (config) => { const stickerPackName = getProjectStickersName( - config.modRequest.projectName! + config.modRequest.projectName!, ); const stickerRootPath = path.join( config.modRequest.platformProjectRoot, - stickerPackName + stickerPackName, ); const filePath = path.join(stickerRootPath, "Info.plist"); diff --git a/packages/ios-stickers/src/withStickerPack.ts b/packages/ios-stickers/src/withStickerPack.ts index 05638c29..5dd4bf55 100644 --- a/packages/ios-stickers/src/withStickerPack.ts +++ b/packages/ios-stickers/src/withStickerPack.ts @@ -15,7 +15,7 @@ const sizeColumnMap: Record = { }; export function normalizeStickersProps( - props: Props["stickers"] = [] + props: Props["stickers"] = [], ): Sticker[] { const imagesObj = props.map((prop) => { if (typeof prop === "string") { @@ -42,8 +42,8 @@ const withStickerPack: ConfigPlugin = (config, options = {}) => { if (!size) { throw new Error( `Column size "${columns}" is invalid. Expected one of: ${Object.keys( - sizeColumnMap - ).join(", ")}` + sizeColumnMap, + ).join(", ")}`, ); } const _stickers = normalizeStickersProps(stickers); diff --git a/packages/ios-stickers/src/withStickerXcodeTarget.ts b/packages/ios-stickers/src/withStickerXcodeTarget.ts index b78d6804..83b80b78 100644 --- a/packages/ios-stickers/src/withStickerXcodeTarget.ts +++ b/packages/ios-stickers/src/withStickerXcodeTarget.ts @@ -18,7 +18,7 @@ export const withStickerXcodeTarget: ConfigPlugin< > = (config, { stickerBundleId }) => { return withXcodeProject(config, (config) => { const stickerPackName = getProjectStickersName( - config.modRequest.projectName! + config.modRequest.projectName!, ); addStickersTarget( @@ -26,13 +26,13 @@ export const withStickerXcodeTarget: ConfigPlugin< stickerPackName, config.ios!.bundleIdentifier!, stickerPackName, - stickerBundleId + stickerBundleId, ); const stickersKey = addStickerResourceFile( config.modResults, STICKERS_ROOT_PATH, - stickerPackName + stickerPackName, ); if (stickersKey) { diff --git a/packages/ios-stickers/src/xcodeSticker.ts b/packages/ios-stickers/src/xcodeSticker.ts index f4d0483a..96cbb14b 100644 --- a/packages/ios-stickers/src/xcodeSticker.ts +++ b/packages/ios-stickers/src/xcodeSticker.ts @@ -21,7 +21,7 @@ export function getMainPBXGroup(proj: XcodeProject) { export function addStickerResourceFile( proj: XcodeProject, path: string, - rootFolderName: string + rootFolderName: string, ) { const opt: Record = {}; @@ -40,7 +40,7 @@ export function addStickerResourceFile( const stickersKey = proj.pbxCreateGroup( // Without quotes, this breaks the xcode project `"${rootFolderName}"`, - `"${rootFolderName}"` + `"${rootFolderName}"`, ); proj.addToPbxBuildFileSection(file); // PBXBuildFile @@ -54,7 +54,7 @@ export function addStickerResourceFile( // "Resources", rootFolderName, // Resources, - file.target + file.target, ); sources.files.push(pbxBuildPhaseObj(file)); }; @@ -89,7 +89,7 @@ export function addStickersTarget( name: string, bundleId: string, subfolder: string, - stickerBundleId?: string + stickerBundleId?: string, ) { // Setup uuid and name of new target const targetUuid = proj.generateUuid(); @@ -166,7 +166,7 @@ export function addStickersTarget( if ( (config as any).buildSettings.ASSETCATALOG_COMPILER_APPICON_NAME && (config as any).buildSettings.ASSETCATALOG_COMPILER_APPICON_NAME.match( - /iMessage App Icon/ + /iMessage App Icon/, ) ) { // Has existing setup... @@ -179,7 +179,7 @@ export function addStickersTarget( const buildConfigurations = proj.addXCConfigurationList( buildConfigurationsList, "Release", - `Build configuration list for PBXNativeTarget ${quoted(targetName)} ` + `Build configuration list for PBXNativeTarget ${quoted(targetName)} `, ); // Product: Create @@ -229,7 +229,7 @@ export function addStickersTarget( "Embed App Extensions", proj.getFirstTarget().uuid, // targetType, - "app_extension" + "app_extension", ); // TODO: Add to https://github.com/apache/cordova-node-xcode/blob/8b98cabc5978359db88dc9ff2d4c015cba40f150/lib/pbxProject.js#L1604 @@ -281,7 +281,7 @@ type PBXFile = any; function correctForResourcesPath( file: PBXFile, project: XcodeProject, - name: string = "Resources" + name: string = "Resources", ) { return correctForPath(file, project, name); } @@ -300,12 +300,12 @@ function correctForPath(file: PBXFile, project: XcodeProject, group: string) { function addToPbxCopyfilesBuildPhase( proj: XcodeProject, file: PBXFile, - name: string + name: string, ) { const sources = proj.buildPhaseObject( "PBXCopyFilesBuildPhase", name || "Copy Files", - file.target + file.target, ); sources.files.push(pbxBuildPhaseObj(file)); } diff --git a/packages/react-native-adjust/src/withReactNativeAdjust.ts b/packages/react-native-adjust/src/withReactNativeAdjust.ts index 8f1cb45e..826d1492 100644 --- a/packages/react-native-adjust/src/withReactNativeAdjust.ts +++ b/packages/react-native-adjust/src/withReactNativeAdjust.ts @@ -48,11 +48,11 @@ const withGradle: ConfigPlugin = (config) => { return withAppBuildGradle(config, (config) => { if (config.modResults.language === "groovy") { config.modResults.contents = addAndroidPackagingOptions( - config.modResults.contents + config.modResults.contents, ).contents; } else { throw new Error( - "Cannot add Play Services maven gradle because the project build.gradle is not groovy" + "Cannot add Play Services maven gradle because the project build.gradle is not groovy", ); } return config; @@ -64,7 +64,7 @@ const withGradle: ConfigPlugin = (config) => { */ const withAdjustPlugin: ConfigPlugin = ( config, - _props + _props, ) => { const props = _props || {}; diff --git a/packages/react-native-blob-util/src/__tests__/withReactNativeBlobUtil-test.ts b/packages/react-native-blob-util/src/__tests__/withReactNativeBlobUtil-test.ts index 364aa85d..3273ce53 100644 --- a/packages/react-native-blob-util/src/__tests__/withReactNativeBlobUtil-test.ts +++ b/packages/react-native-blob-util/src/__tests__/withReactNativeBlobUtil-test.ts @@ -32,7 +32,7 @@ describe(appendDownloadCompleteAction, () => { const firstResults = XML.format(manifest); expect(firstResults).toMatchSnapshot(); expect(firstResults).toMatch( - // + //, ); // Doesn't mutate original. @@ -48,14 +48,14 @@ describe(ensureBlobProviderManifest, () => { const first = XML.format(ensureBlobProviderManifest(manifest)); expect(first).toContain( - '' + '', ); // Doesn't add duplicates expect( XML.format( - ensureBlobProviderManifest(ensureBlobProviderManifest(manifest)) - ) + ensureBlobProviderManifest(ensureBlobProviderManifest(manifest)), + ), ).toEqual(first); }); }); @@ -64,7 +64,7 @@ describe(ensureBlobProviderAuthorityString, () => { it("should ensure provider", async () => { const res = ensureBlobProviderAuthorityString( { resources: {} }, - "app.bacon" + "app.bacon", ); const result = XML.format(res); expect(result).toMatchInlineSnapshot(` diff --git a/packages/react-native-blob-util/src/withReactNativeBlobUtil.ts b/packages/react-native-blob-util/src/withReactNativeBlobUtil.ts index 5e7ebb9d..c9b52ac6 100644 --- a/packages/react-native-blob-util/src/withReactNativeBlobUtil.ts +++ b/packages/react-native-blob-util/src/withReactNativeBlobUtil.ts @@ -16,7 +16,7 @@ try { } export function appendDownloadCompleteAction( - androidManifest: AndroidConfig.Manifest.AndroidManifest + androidManifest: AndroidConfig.Manifest.AndroidManifest, ): AndroidConfig.Manifest.AndroidManifest { if (!Array.isArray(androidManifest.manifest.application)) { return androidManifest; @@ -28,7 +28,7 @@ export function appendDownloadCompleteAction( for (const intentFilter of activity["intent-filter"] || []) { const isLauncher = intentFilter.category?.some( (action) => - action.$["android:name"] === "android.intent.category.LAUNCHER" + action.$["android:name"] === "android.intent.category.LAUNCHER", ); if (!isLauncher) continue; @@ -36,7 +36,7 @@ export function appendDownloadCompleteAction( const hasDownloadCompleteAction = intentFilter.action.some( (action) => action.$["android:name"] === - "android.intent.action.DOWNLOAD_COMPLETE" + "android.intent.action.DOWNLOAD_COMPLETE", ); if (!hasDownloadCompleteAction) { intentFilter.action.push({ @@ -64,10 +64,10 @@ const withBlobProvider: ConfigPlugin = (config) => { }; export function ensureBlobProviderManifest( - androidManifest: AndroidConfig.Manifest.AndroidManifest + androidManifest: AndroidConfig.Manifest.AndroidManifest, ) { const app = AndroidConfig.Manifest.getMainApplicationOrThrow( - androidManifest + androidManifest, ) as AndroidConfig.Manifest.ManifestApplication & { provider?: any[] }; if (!app.provider) { @@ -76,7 +76,7 @@ export function ensureBlobProviderManifest( if ( !app.provider.some( (p) => - p.$["android:name"] === "com.facebook.react.modules.blob.BlobProvider" + p.$["android:name"] === "com.facebook.react.modules.blob.BlobProvider", ) ) { // @@ -110,7 +110,7 @@ const withReactNativeBlobUtil: ConfigPlugin = (config) => { config = withStringsXml(config, (config) => { ensureBlobProviderAuthorityString( config.modResults, - config.android?.package + ".blobs" + config.android?.package + ".blobs", ); return config; }); @@ -120,7 +120,7 @@ const withReactNativeBlobUtil: ConfigPlugin = (config) => { export function ensureBlobProviderAuthorityString( res: AndroidConfig.Resources.ResourceXML, - authority: string + authority: string, ) { if (!res.resources.string) { res.resources.string = []; @@ -137,7 +137,7 @@ export function ensureBlobProviderAuthorityString( } const item = res.resources.string.find( - (s) => s.$["name"] === "blob_provider_authority" + (s) => s.$["name"] === "blob_provider_authority", ); item!._ = authority; return res; @@ -146,5 +146,5 @@ export function ensureBlobProviderAuthorityString( export default createRunOncePlugin( withReactNativeBlobUtil, pkg.name, - pkg.version + pkg.version, ); diff --git a/packages/react-native-branch/src/__tests__/withBranchAndroid-test.ts b/packages/react-native-branch/src/__tests__/withBranchAndroid-test.ts index e6986a4a..861003b5 100644 --- a/packages/react-native-branch/src/__tests__/withBranchAndroid-test.ts +++ b/packages/react-native-branch/src/__tests__/withBranchAndroid-test.ts @@ -9,7 +9,7 @@ const { findMetaDataItem, getMainApplication, readAndroidManifestAsync } = const sampleManifestPath = resolve( __dirname, "./fixtures", - "react-native-AndroidManifest.xml" + "react-native-AndroidManifest.xml", ); describe(getBranchApiKey, () => { @@ -21,24 +21,23 @@ describe(getBranchApiKey, () => { expect( getBranchApiKey({ android: { config: { branch: { apiKey: "MY-API-KEY" } } }, - } as any) + } as any), ).toBe("MY-API-KEY"); }); }); describe(setBranchApiKey, () => { it("sets branch api key in AndroidManifest.xml if given", async () => { - let androidManifestJson = await readAndroidManifestAsync( - sampleManifestPath - ); + let androidManifestJson = + await readAndroidManifestAsync(sampleManifestPath); androidManifestJson = await setBranchApiKey( "MY-API-KEY", - androidManifestJson + androidManifestJson, ); let mainApplication = getMainApplication(androidManifestJson); expect( - findMetaDataItem(mainApplication, "io.branch.sdk.BranchKey") + findMetaDataItem(mainApplication, "io.branch.sdk.BranchKey"), ).toBeGreaterThan(-1); // Unset the item @@ -47,7 +46,7 @@ describe(setBranchApiKey, () => { mainApplication = getMainApplication(androidManifestJson); expect(findMetaDataItem(mainApplication, "io.branch.sdk.BranchKey")).toBe( - -1 + -1, ); }); }); diff --git a/packages/react-native-branch/src/__tests__/withBranchIOS-test.ts b/packages/react-native-branch/src/__tests__/withBranchIOS-test.ts index ea31914d..11e0a3b0 100644 --- a/packages/react-native-branch/src/__tests__/withBranchIOS-test.ts +++ b/packages/react-native-branch/src/__tests__/withBranchIOS-test.ts @@ -7,7 +7,7 @@ describe(getBranchApiKey, () => { it(`returns the api key if provided`, () => { expect( - getBranchApiKey({ ios: { config: { branch: { apiKey: "123" } } } }) + getBranchApiKey({ ios: { config: { branch: { apiKey: "123" } } } }), ).toBe("123"); }); }); diff --git a/packages/react-native-branch/src/withBranch.ts b/packages/react-native-branch/src/withBranch.ts index 03e51e74..57dc39e9 100644 --- a/packages/react-native-branch/src/withBranch.ts +++ b/packages/react-native-branch/src/withBranch.ts @@ -6,7 +6,7 @@ import { withBranchIOS } from "./withBranchIOS"; const withBranch: ConfigPlugin = ( config, - { apiKey, iosAppDomain, iosUniversalLinkDomains } = {} + { apiKey, iosAppDomain, iosUniversalLinkDomains } = {}, ) => { config = withBranchAndroid(config, { apiKey }); config = withBranchIOS(config, { diff --git a/packages/react-native-branch/src/withBranchAndroid.ts b/packages/react-native-branch/src/withBranchAndroid.ts index e3b68334..555ff197 100644 --- a/packages/react-native-branch/src/withBranchAndroid.ts +++ b/packages/react-native-branch/src/withBranchAndroid.ts @@ -19,7 +19,7 @@ export function getBranchApiKey(config: ExpoConfig) { export function setBranchApiKey( apiKey: string, - androidManifest: AndroidConfig.Manifest.AndroidManifest + androidManifest: AndroidConfig.Manifest.AndroidManifest, ) { const mainApplication = getMainApplicationOrThrow(androidManifest); @@ -36,12 +36,12 @@ export function setBranchApiKey( export const withBranchAndroid: ConfigPlugin<{ apiKey?: string }> = ( config, - data + data, ) => { const apiKey = data.apiKey ?? getBranchApiKey(config); if (!apiKey) { throw new Error( - "Branch API key is required: expo.android.config.branch.apiKey" + "Branch API key is required: expo.android.config.branch.apiKey", ); } diff --git a/packages/react-native-branch/src/withBranchIOS.ts b/packages/react-native-branch/src/withBranchIOS.ts index 53018845..bc629f35 100644 --- a/packages/react-native-branch/src/withBranchIOS.ts +++ b/packages/react-native-branch/src/withBranchIOS.ts @@ -9,7 +9,7 @@ export function getBranchApiKey(config: Pick) { export function setBranchApiKey( apiKey: string | null, - infoPlist: InfoPlist + infoPlist: InfoPlist, ): InfoPlist { if (apiKey === null) { return infoPlist; @@ -32,7 +32,7 @@ export const withBranchIOS: ConfigPlugin = (config, data) => { const apiKey = data.apiKey ?? getBranchApiKey(config); if (!apiKey) { throw new Error( - "Branch API key is required: expo.ios.config.branch.apiKey" + "Branch API key is required: expo.ios.config.branch.apiKey", ); } diff --git a/packages/react-native-callkeep/src/withCallkeep.ts b/packages/react-native-callkeep/src/withCallkeep.ts index 2a3fd8ee..5dfcc4de 100644 --- a/packages/react-native-callkeep/src/withCallkeep.ts +++ b/packages/react-native-callkeep/src/withCallkeep.ts @@ -34,7 +34,7 @@ const withAndroidManifestService: ConfigPlugin = (config) => { // ; const app = AndroidConfig.Manifest.getMainApplicationOrThrow( - config.modResults + config.modResults, ); if (!Array.isArray(app.service)) app.service = []; @@ -43,7 +43,7 @@ const withAndroidManifestService: ConfigPlugin = (config) => { !app.service.find( (item) => item.$["android:name"] === - "io.wazo.callkeep.RNCallKeepBackgroundMessagingService" + "io.wazo.callkeep.RNCallKeepBackgroundMessagingService", ) ) { app.service.push({ @@ -58,7 +58,7 @@ const withAndroidManifestService: ConfigPlugin = (config) => { if ( !app.service.find( (item) => - item.$["android:name"] === "io.wazo.callkeep.VoiceConnectionService" + item.$["android:name"] === "io.wazo.callkeep.VoiceConnectionService", ) ) { app.service.push({ diff --git a/packages/react-native-dynamic-app-icon/src/index.ts b/packages/react-native-dynamic-app-icon/src/index.ts index b1b70ff4..0057a68a 100644 --- a/packages/react-native-dynamic-app-icon/src/index.ts +++ b/packages/react-native-dynamic-app-icon/src/index.ts @@ -25,13 +25,13 @@ type Props = { function arrayToImages(images: string[]) { return images.reduce( (prev, curr, i) => ({ ...prev, [i]: { image: curr } }), - {} + {}, ); } const withDynamicIcon: ConfigPlugin = ( config, - props = {} + props = {}, ) => { const _props = props || {}; @@ -63,7 +63,7 @@ const withIconXcodeProject: ConfigPlugin = (config, { icons }) => { const groupPath = `${config.modRequest.projectName!}/${folderName}`; const group = IOSConfig.XcodeUtils.ensureGroupRecursively( config.modResults, - groupPath + groupPath, ); const project = config.modResults; const opt: any = {}; @@ -74,13 +74,13 @@ const withIconXcodeProject: ConfigPlugin = (config, { icons }) => { (id) => { const _group = project.hash.project.objects["PBXGroup"][id]; return _group.name === group.name; - } + }, ); if (!project.hash.project.objects["PBXVariantGroup"]) { project.hash.project.objects["PBXVariantGroup"] = {}; } const variantGroupId = Object.keys( - project.hash.project.objects["PBXVariantGroup"] + project.hash.project.objects["PBXVariantGroup"], ).find((id) => { const _group = project.hash.project.objects["PBXVariantGroup"][id]; return _group.name === group.name; @@ -115,7 +115,7 @@ const withIconXcodeProject: ConfigPlugin = (config, { icons }) => { if ( !group?.children.some( - ({ comment }: { comment: string }) => comment === iconFileName + ({ comment }: { comment: string }) => comment === iconFileName, ) ) { // Only write the file if it doesn't already exist. @@ -192,11 +192,11 @@ const withIconImages: ConfigPlugin = (config, props) => { async function createIconsAsync( config: ExportedConfigWithProps, - { icons }: Props + { icons }: Props, ) { const iosRoot = path.join( config.modRequest.platformProjectRoot, - config.modRequest.projectName! + config.modRequest.projectName!, ); // Delete all existing assets @@ -226,7 +226,7 @@ async function createIconsAsync( resizeMode: "cover", width: scaledSize, height: scaledSize, - } + }, ); await fs.promises.writeFile(outputPath, source); @@ -239,8 +239,8 @@ async function iterateIconsAsync( callback: ( key: string, icon: { image: string; prerendered?: boolean }, - index: number - ) => Promise + index: number, + ) => Promise, ) { const entries = Object.entries(icons); for (let i = 0; i < entries.length; i++) { diff --git a/packages/react-native-google-cast/src/__tests__/withIosGoogleCast-test.ts b/packages/react-native-google-cast/src/__tests__/withIosGoogleCast-test.ts index 3b9a73b0..6902a8d7 100644 --- a/packages/react-native-google-cast/src/__tests__/withIosGoogleCast-test.ts +++ b/packages/react-native-google-cast/src/__tests__/withIosGoogleCast-test.ts @@ -7,7 +7,7 @@ describe(addGoogleCastAppDelegateDidFinishLaunchingWithOptions, () => { getFixture("AppDelegate.mm"), { receiverAppId: "foobar-bacon", - } + }, ); // matches a static snapshot expect(results.contents).toMatchSnapshot(); @@ -20,7 +20,7 @@ describe(addGoogleCastAppDelegateDidFinishLaunchingWithOptions, () => { it(`fails to add to a malformed app delegate`, () => { expect(() => - addGoogleCastAppDelegateDidFinishLaunchingWithOptions(`foobar`, {}) + addGoogleCastAppDelegateDidFinishLaunchingWithOptions(`foobar`, {}), ).toThrow(/foobar/); }); }); diff --git a/packages/react-native-google-cast/src/withAndroidGoogleCast.ts b/packages/react-native-google-cast/src/withAndroidGoogleCast.ts index 30a5441a..ae956dac 100644 --- a/packages/react-native-google-cast/src/withAndroidGoogleCast.ts +++ b/packages/react-native-google-cast/src/withAndroidGoogleCast.ts @@ -66,7 +66,7 @@ async function ensureCustomActivityAsync({ const withAndroidManifestCast: ConfigPlugin = ( config, - { receiverAppId } = {} + { receiverAppId } = {}, ) => { return withAndroidManifest(config, async (config) => { const mainApplication = getMainApplicationOrThrow(config.modResults); @@ -77,13 +77,13 @@ const withAndroidManifestCast: ConfigPlugin = ( mainApplication, META_PROVIDER_CLASS, // This is the native Java class - "com.reactnative.googlecast.GoogleCastOptionsProvider" + "com.reactnative.googlecast.GoogleCastOptionsProvider", ); if (receiverAppId) { addMetaDataItemToMainApplication( mainApplication, META_RECEIVER_APP_ID, - receiverAppId + receiverAppId, ); } return config; @@ -92,18 +92,18 @@ const withAndroidManifestCast: ConfigPlugin = ( const withProjectBuildGradleVersion: ConfigPlugin<{ version?: string }> = ( config, - { version } + { version }, ) => { return withProjectBuildGradle(config, (config) => { if (config.modResults.language !== "groovy") throw new Error( - "react-native-google-cast config plugin does not support Kotlin /build.gradle yet." + "react-native-google-cast config plugin does not support Kotlin /build.gradle yet.", ); config.modResults.contents = addGoogleCastVersionImport( config.modResults.contents, { version, - } + }, ).contents; return config; @@ -112,12 +112,12 @@ const withProjectBuildGradleVersion: ConfigPlugin<{ version?: string }> = ( const withAppBuildGradleImport: ConfigPlugin<{ version?: string }> = ( config, - { version } + { version }, ) => { return withAppBuildGradle(config, (config) => { if (config.modResults.language !== "groovy") throw new Error( - "react-native-google-cast config plugin does not support Kotlin app/build.gradle yet." + "react-native-google-cast config plugin does not support Kotlin app/build.gradle yet.", ); config.modResults.contents = addSafeExtGet(config.modResults.contents); @@ -125,7 +125,7 @@ const withAppBuildGradleImport: ConfigPlugin<{ version?: string }> = ( config.modResults.contents, { version, - } + }, ).contents; return config; @@ -137,12 +137,12 @@ const withMainActivityLazyLoading: ConfigPlugin = (config) => { const src = addImports( config.modResults.contents, ["com.google.android.gms.cast.framework.CastContext"], - config.modResults.language === "java" + config.modResults.language === "java", ); config.modResults.contents = addGoogleCastLazyLoadingImport( src, - config.modResults.language + config.modResults.language, ).contents; return config; @@ -180,12 +180,12 @@ export const withAndroidGoogleCast: ConfigPlugin<{ function addGoogleCastLazyLoadingImport( src: string, - language: keyof typeof MAIN_ACTIVITY_LANGUAGES + language: keyof typeof MAIN_ACTIVITY_LANGUAGES, ) { const mainActivity = MAIN_ACTIVITY_LANGUAGES[language]; if (!mainActivity) { throw new Error( - `react-native-google-cast config plugin does not support MainActivity.${language} yet` + `react-native-google-cast config plugin does not support MainActivity.${language} yet`, ); } @@ -206,12 +206,12 @@ function addGoogleCastLazyLoadingImport( // dependencies { implementation "com.google.android.gms:play-services-cast-framework:+" } function addGoogleCastImport( src: string, - { version }: { version?: string } = {} + { version }: { version?: string } = {}, ) { const newSrc = []; newSrc.push( - ` implementation "com.google.android.gms:play-services-cast-framework:\${safeExtGet('castFrameworkVersion', '${version}')}"` + ` implementation "com.google.android.gms:play-services-cast-framework:\${safeExtGet('castFrameworkVersion', '${version}')}"`, ); return mergeContents({ @@ -238,7 +238,7 @@ function addSafeExtGet(src: string) { newSrc.push( "def safeExtGet(prop, fallback) {", " rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback", - "}" + "}", ); return mergeContents({ @@ -254,7 +254,7 @@ function addSafeExtGet(src: string) { function addGoogleCastVersionImport( src: string, - { version }: { version?: string } = {} + { version }: { version?: string } = {}, ) { const newSrc = []; newSrc.push(` castFrameworkVersion = "${version}"`); diff --git a/packages/react-native-google-cast/src/withIosGoogleCast.ts b/packages/react-native-google-cast/src/withIosGoogleCast.ts index 8d563ae0..49b461d1 100644 --- a/packages/react-native-google-cast/src/withIosGoogleCast.ts +++ b/packages/react-native-google-cast/src/withIosGoogleCast.ts @@ -46,7 +46,7 @@ const withIosLocalNetworkPermissions: ConfigPlugin<{ // Add required values config.modResults.NSBonjourServices.push( "_googlecast._tcp", - `_${receiverAppId}._googlecast._tcp` + `_${receiverAppId}._googlecast._tcp`, ); // Remove duplicates @@ -81,16 +81,16 @@ const withIosAppDelegateLoaded: ConfigPlugin = (config, props) => { return withAppDelegate(config, (config) => { if (!["objc", "objcpp"].includes(config.modResults.language)) { throw new Error( - "react-native-google-cast config plugin does not support AppDelegate' that aren't Objective-C(++) yet." + "react-native-google-cast config plugin does not support AppDelegate' that aren't Objective-C(++) yet.", ); } config.modResults.contents = addGoogleCastAppDelegateDidFinishLaunchingWithOptions( config.modResults.contents, - props + props, ).contents; config.modResults.contents = addGoogleCastAppDelegateImport( - config.modResults.contents + config.modResults.contents, ).contents; return config; @@ -135,7 +135,7 @@ export function addGoogleCastAppDelegateDidFinishLaunchingWithOptions( receiverAppId = null, disableDiscoveryAutostart = false, startDiscoveryAfterFirstTapOnCastButton = true, - }: IosProps = {} + }: IosProps = {}, ) { let newSrc = []; newSrc.push( @@ -152,10 +152,10 @@ export function addGoogleCastAppDelegateDidFinishLaunchingWithOptions( // TODO: Same as above, read statically // ` options.disableDiscoveryAutostart = ${String(!!disableDiscoveryAutostart)};`, ` options.startDiscoveryAfterFirstTapOnCastButton = ${String( - !!startDiscoveryAfterFirstTapOnCastButton + !!startDiscoveryAfterFirstTapOnCastButton, )};`, " [GCKCastContext setSharedInstanceWithOptions:options];", - "#endif" + "#endif", ); newSrc = newSrc.filter(Boolean); @@ -175,7 +175,7 @@ function addGoogleCastAppDelegateImport(src: string) { newSrc.push( "#if __has_include()", "#import ", - "#endif" + "#endif", ); return mergeContents({ diff --git a/packages/react-native-pdf/src/withPdf.ts b/packages/react-native-pdf/src/withPdf.ts index f7771adf..c460d967 100644 --- a/packages/react-native-pdf/src/withPdf.ts +++ b/packages/react-native-pdf/src/withPdf.ts @@ -19,12 +19,12 @@ export const withAndroidPackagingOptions: ConfigPlugin = (config) => { return withAppBuildGradle(config, (config) => { if (config.modResults.language === "groovy") { config.modResults.contents = addAndroidPackagingOptions( - config.modResults.contents + config.modResults.contents, ).contents; } else { WarningAggregator.addWarningAndroid( "@config-plugins/react-native-pdf", - `Cannot automatically configure app build.gradle if it's not groovy` + `Cannot automatically configure app build.gradle if it's not groovy`, ); } return config; diff --git a/packages/react-native-siri-shortcut/src/__tests__/withReactNativeSiriShortcut.test.ts b/packages/react-native-siri-shortcut/src/__tests__/withReactNativeSiriShortcut.test.ts index c1fd01d3..d59665f6 100644 --- a/packages/react-native-siri-shortcut/src/__tests__/withReactNativeSiriShortcut.test.ts +++ b/packages/react-native-siri-shortcut/src/__tests__/withReactNativeSiriShortcut.test.ts @@ -30,7 +30,7 @@ describe(addSiriShortcutAppDelegateInit, () => { expect(results.contents).toMatchSnapshot(); expect(results.contents).toMatch(/react-native-siri-shortcut-delegate/); expect(results.contents).toMatch( - /RNSSSiriShortcuts application:application/ + /RNSSSiriShortcuts application:application/, ); // did add new content expect(results.didMerge).toBe(true); diff --git a/packages/react-native-siri-shortcut/src/withReactNativeSiriShortcut.ts b/packages/react-native-siri-shortcut/src/withReactNativeSiriShortcut.ts index 423d3f44..c32f04a4 100644 --- a/packages/react-native-siri-shortcut/src/withReactNativeSiriShortcut.ts +++ b/packages/react-native-siri-shortcut/src/withReactNativeSiriShortcut.ts @@ -15,7 +15,7 @@ import { */ const withReactNativeSiriShortcut: ConfigPlugin = ( config, - activityTypes + activityTypes, ) => { withSiriShortcutAppDelegate(config); withSiriEntitlements(config); @@ -30,7 +30,7 @@ const withReactNativeSiriShortcut: ConfigPlugin = ( const withReactNativeSiriShortcutInfoPlist: ConfigPlugin = ( config, - activityTypes + activityTypes, ) => { return withInfoPlist(config, (config) => { config.modResults.NSUserActivityTypes = activityTypes; @@ -75,22 +75,22 @@ const withSiriShortcutAppDelegate: ConfigPlugin = (config) => { if (["objc", "objcpp"].includes(config.modResults.language)) { try { config.modResults.contents = addSiriShortcutAppDelegateImport( - config.modResults.contents + config.modResults.contents, ).contents; config.modResults.contents = addSiriShortcutAppDelegateInit( - config.modResults.contents + config.modResults.contents, ).contents; } catch (error: any) { if (error.code === "ERR_NO_MATCH") { throw new Error( - `Cannot add Siri Shortcut to the project's AppDelegate because it's malformed. Please report this with a copy of your project AppDelegate.` + `Cannot add Siri Shortcut to the project's AppDelegate because it's malformed. Please report this with a copy of your project AppDelegate.`, ); } throw error; } } else { throw new Error( - "Cannot setup Siri Shortcut because the AppDelegate is not Objective C" + "Cannot setup Siri Shortcut because the AppDelegate is not Objective C", ); } return config; @@ -111,5 +111,5 @@ const pkg = { export default createRunOncePlugin( withReactNativeSiriShortcut, pkg.name, - pkg.version + pkg.version, ); diff --git a/packages/react-native-webrtc/src/withBitcodeDisabled.ts b/packages/react-native-webrtc/src/withBitcodeDisabled.ts index 2943711d..95f6c7f3 100644 --- a/packages/react-native-webrtc/src/withBitcodeDisabled.ts +++ b/packages/react-native-webrtc/src/withBitcodeDisabled.ts @@ -8,7 +8,7 @@ export const withBitcodeDisabled: ConfigPlugin = (config) => { if (config.ios?.bitcode != null && config.ios?.bitcode !== false) { WarningAggregator.addWarningIOS( "ios.bitcode", - "react-native-webrtc plugin is overwriting project bitcode settings. WebRTC requires bitcode to be disabled for builds, targeting physical iOS devices." + "react-native-webrtc plugin is overwriting project bitcode settings. WebRTC requires bitcode to be disabled for builds, targeting physical iOS devices.", ); } // WebRTC requires Bitcode be disabled for diff --git a/packages/react-native-webrtc/src/withPermissions.ts b/packages/react-native-webrtc/src/withPermissions.ts index 2b113267..811f0c2a 100644 --- a/packages/react-native-webrtc/src/withPermissions.ts +++ b/packages/react-native-webrtc/src/withPermissions.ts @@ -10,7 +10,7 @@ export type IOSPermissionsProps = { export const withPermissions: ConfigPlugin = ( config, - props + props, ) => { return withInfoPlist(config, (config) => { const { cameraPermission, microphonePermission } = props || {}; diff --git a/packages/react-native-webrtc/src/withWebRTC.ts b/packages/react-native-webrtc/src/withWebRTC.ts index 6e13f546..e3e5b38c 100644 --- a/packages/react-native-webrtc/src/withWebRTC.ts +++ b/packages/react-native-webrtc/src/withWebRTC.ts @@ -1,9 +1,9 @@ -import { withBuildProperties } from "expo-build-properties"; import { AndroidConfig, ConfigPlugin, createRunOncePlugin, } from "expo/config-plugins"; +import { withBuildProperties } from "expo-build-properties"; import { withBitcodeDisabled } from "./withBitcodeDisabled"; import { withDesugaring } from "./withDesugaring"; @@ -13,7 +13,7 @@ const pkg = { name: "react-native-webrtc", version: "UNVERSIONED" }; //require(" const withWebRTC: ConfigPlugin = ( config, - props = {} + props = {}, ) => { const _props = props || {};