diff --git a/.eslintrc.js b/.eslintrc.js index 45cf2c1..8e39d62 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,5 +1,5 @@ module.exports = { root: true, - extends: ['universe/native', 'universe/web'], - ignorePatterns: ['build'], + extends: ["universe/native", "universe/web"], + ignorePatterns: ["build"], }; diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..0385f5f --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "singleQuote": false, + "arrowParens": "always", + "semi": true, + "trailingComma": "all" +} diff --git a/src/RNWallet.types.ts b/src/RNWallet.types.ts index 006a414..996dbaf 100644 --- a/src/RNWallet.types.ts +++ b/src/RNWallet.types.ts @@ -1,4 +1,4 @@ -import { StyleProp, ViewStyle } from 'react-native'; +import { StyleProp, ViewStyle } from "react-native"; /** * @platform ios diff --git a/src/RNWalletModule.ts b/src/RNWalletModule.ts index 81f0d8f..7af9c4e 100644 --- a/src/RNWalletModule.ts +++ b/src/RNWalletModule.ts @@ -1,11 +1,11 @@ -import { requireNativeModule } from 'expo-modules-core'; -import { Platform } from 'react-native'; +import { requireNativeModule } from "expo-modules-core"; +import { Platform } from "react-native"; -import { ButtonType, RNWalletConstants } from './RNWallet.types'; +import { ButtonType, RNWalletConstants } from "./RNWallet.types"; // It loads the native module object from the JSI or falls back to // the bridge module (from NativeModulesProxy) if the remote debugger is on. -const RNWalletModule = requireNativeModule('RNWallet'); +const RNWalletModule = requireNativeModule("RNWallet"); export const Constants: RNWalletConstants = { buttonLayout: { @@ -13,7 +13,7 @@ export const Constants: RNWalletConstants = { baseHeight: RNWalletModule.buttonLayout?.baseHeight, baseWidthFromType(type) { - if (Platform.OS === 'android') { + if (Platform.OS === "android") { if (type === ButtonType.PRIMARY) { return RNWalletModule.buttonLayout?.baseWidthPrimary; } diff --git a/src/RNWalletView.tsx b/src/RNWalletView.tsx index 2e60bff..fa17c6b 100644 --- a/src/RNWalletView.tsx +++ b/src/RNWalletView.tsx @@ -1,13 +1,13 @@ -import { requireNativeViewManager } from 'expo-modules-core'; -import * as React from 'react'; -import { Platform, StyleSheet } from 'react-native'; +import { requireNativeViewManager } from "expo-modules-core"; +import * as React from "react"; +import { Platform, StyleSheet } from "react-native"; -import { ButtonType, RNWalletViewProps } from './RNWallet.types'; -import { Constants } from './RNWalletModule'; +import { ButtonType, RNWalletViewProps } from "./RNWallet.types"; +import { Constants } from "./RNWalletModule"; const NativeView: React.ComponentType< - Omit & { onButtonPress?: () => void } -> = requireNativeViewManager('RNWallet'); + Omit & { onButtonPress?: () => void } +> = requireNativeViewManager("RNWallet"); export default function RNWalletView({ onPress, diff --git a/src/index.ts b/src/index.ts index 359e5d6..17e5f91 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ -import { Platform } from 'react-native'; +import { Platform } from "react-native"; -import RNWalletModule, { Constants } from './RNWalletModule'; -import RNWalletView from './RNWalletView'; +import RNWalletModule, { Constants } from "./RNWalletModule"; +import RNWalletView from "./RNWalletView"; export function canAddPasses() { return RNWalletModule.canAddPasses(); @@ -22,8 +22,8 @@ export function addPass(urlOrToken: string): Promise { * @platform ios */ export function hasPass(url: string): Promise { - if (Platform.OS !== 'ios') { - console.warn('RNWallet.hasPass is only available on iOS'); + if (Platform.OS !== "ios") { + console.warn("RNWallet.hasPass is only available on iOS"); return Promise.resolve(false); } @@ -39,8 +39,8 @@ export function hasPass(url: string): Promise { * @platform ios */ export function removePass(url: string): Promise { - if (Platform.OS !== 'ios') { - console.warn('RNWallet.removePass is only available on iOS'); + if (Platform.OS !== "ios") { + console.warn("RNWallet.removePass is only available on iOS"); return Promise.resolve(); } @@ -48,4 +48,4 @@ export function removePass(url: string): Promise { } export { RNWalletView, Constants }; -export * from './RNWallet.types'; +export * from "./RNWallet.types";