swellstores / swell-js

JS library for building storefronts and checkouts with Swell ecommerce.
https://swell.is
MIT License
138 stars 29 forks source link

fix: some types to accept both Snake and Camel case objects #173

Closed awwit closed 4 months ago

awwit commented 4 months ago

This Pull Request does not contain functional changes.

Fixed many type definitions to accept object keys in Snake and Camel notations. The types were reviewed and updated in accordance with the data models. Also, some important missing fields have been added such as purchase_option for order items.

[DRY] Converting Snake object keys to Camel notation has been moved to a separate utility type.

Additionally, eslint was configured for linting *.d.ts files. Also, a pre-commit git hook was configured to perform linting code and tests before creating a commit. This will help us avoid critical type errors in the future.

Bugs detected by eslint, such as unused variables and arguments, have been fixed. This was necessary for the linter to report new problems when executing git hooks.

Added skipped tests to validate card input.