<?php
$quoteHelper = $block->getHelper();
$showCart = (int)$quoteHelper->getConfigAddToCart();
$showPrice = (int)$quoteHelper->getConfigShowPrice();
$formData = [
    'showCart'          => $showCart,
    'showPrice'         => $showPrice
];
$serializedFormData = $block->getJsonHelper()->jsonEncode($formData);
// phpcs:disable ?>
<script type="text/x-magento-init">
    {
        "*": {
            "mtCompareList": <?= /* @noEscape */ $serializedFormData; ?>
        }
    }
</script>
<?php // phpcs:enable ?>