Enable verbatimModuleSyntax and related eslint rule, fix imports
What changes are you making?
Currently @shopify/checkout-sheet-kit is broken when used in a codebase with verbatimModuleSyntax enabled.
Some type imports were not imported correctly using import type.
This PR aims to fix this.
- fixed the faulty imports
- enable TS
verbatimModuleSyntax - enable the eslint rule to enforce this behaviour
How to test
PR Checklist
[!IMPORTANT]
- [ ] I've added tests to support my implementation
- [x] I have read and agree with the Contribution Guidelines.
- [x] I have read and agree with the Code of Conduct.
- [ ] I've updated the README.
Checklist for releasing a new version
- [ ] I have bumped the version number in the
package.jsonfile. - [ ] I have added a Changelog entry.
[!TIP] See the Contributing documentation for instructions on how to publish a new version of the library.
I have signed the CLA!
Thanks for this @moimael!
Do you mind separating the
typeimports from the non-types?Like this:
import {NativeModules, NativeEventEmitter} from 'react-native'; import type {EmitterSubscription} from 'react-native'; import {ShopifyCheckoutSheetProvider, useShopifyCheckoutSheet} from './context'; import {ColorScheme} from './index.d'; import type { CheckoutEvent, CheckoutEventCallback, Configuration, ShopifyCheckoutSheetKit, } from './index.d'; import type {CheckoutException, CheckoutNativeError} from './errors.d'; import { CheckoutErrorCode, CheckoutExpiredError, CheckoutClientError, CheckoutHTTPError, ConfigurationError, InternalError, CheckoutNativeErrorType, GenericError, } from './errors.d'; import type {CheckoutCompletedEvent} from './events.d'; import type {CustomEvent, PixelEvent, StandardEvent} from './pixels.d';
Done!
@markmur Can you approve the CI workflow again? I forced push to be able to sign my commits since it was a requirement in the CI.
This was released as part of 3.0.4. Thanks for contributing!