diff --git a/modules/@shopify/checkout-sheet-kit/src/ShopifyCheckoutEventProvider.tsx b/modules/@shopify/checkout-sheet-kit/src/ShopifyCheckoutEventProvider.tsx index b46e5953..80c55930 100644 --- a/modules/@shopify/checkout-sheet-kit/src/ShopifyCheckoutEventProvider.tsx +++ b/modules/@shopify/checkout-sheet-kit/src/ShopifyCheckoutEventProvider.tsx @@ -17,13 +17,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import React, {createContext, useContext, useRef, useCallback} from 'react'; -import {UIManager, findNodeHandle} from 'react-native'; +import React, { createContext, useContext, useRef, useCallback } from 'react'; +import { UIManager, findNodeHandle } from 'react-native'; interface CheckoutEventContextType { registerWebView: (webViewRef: React.RefObject) => void; unregisterWebView: () => void; - respondToEvent: (eventId: string, response: any) => Promise; + respondToEvent: (eventId: string, response: any) => boolean; } const CheckoutEventContext = createContext( @@ -52,7 +52,7 @@ export const ShopifyCheckoutEventProvider = ({ }, []); const respondToEvent = useCallback( - async (eventId: string, response: any): Promise => { + (eventId: string, response: any): boolean => { if (!webViewRef.current?.current) { return false; } @@ -112,11 +112,11 @@ export function useShopifyEvent(eventId: string) { return { id: eventId, respondWith: useCallback( - async (response: any) => { + (response: any) => { if (!eventContext) { return false; } - return await eventContext.respondToEvent(eventId, response); + return eventContext.respondToEvent(eventId, response); }, [eventId, eventContext], ), diff --git a/package.json b/package.json index f301a90b..4a20a981 100644 --- a/package.json +++ b/package.json @@ -82,10 +82,18 @@ "eslintConfig": { "root": true, "extends": "@react-native", + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "./tsconfig.json" + }, + "plugins": [ + "@typescript-eslint" + ], "rules": { "@typescript-eslint/no-shadow": "off", "@typescript-eslint/consistent-type-imports": "error", + "@typescript-eslint/require-await": "error", "no-console": "error" } } -} +} \ No newline at end of file diff --git a/sample/.eslintignore b/sample/.eslintignore index ba885ebe..31ab1c6d 100644 --- a/sample/.eslintignore +++ b/sample/.eslintignore @@ -1,2 +1,2 @@ -android/build -android/app/build +android/ +ios/