g-plane / markup_fmt

Configurable HTML, Vue, Svelte, Astro, Angular, Jinja, Twig, Nunjucks and Vento formatter with dprint integration.
https://dprint.dev/plugins/markup_fmt/
MIT License
105 stars 10 forks source link

Astro complex JSX formatting #77

Open predaytor opened 2 weeks ago

predaytor commented 2 weeks ago

This code does not appear to be formatted properly. Is there a fix? Thx. dprint.jsonc:

upd:

repro: https://stackblitz.com/~/github.com/predaytor/astro-dprint

playground: https://dprint.dev/playground/#code/DwEwlgbgBAxgNgQwM5ILwCIAOAnA9gKwFMYAXJdAPgCgBIAbxwOLIDoBbBTACi8aNIA0UPswCSIAB4BKKKgpQutGqEixEKDCNKUl9LSRYBzBHDiFsAT3aceAfSRwwIQkIdPC46bPl1dNGLgAdkgkUBKyUIEArqYA3FR+2IQkUdiBUCrQ8Mho6G7OlMAA9OAQFPE0lQC+UlVKxaXUNFK1VA2Q1EA/plugin/markup_fmt

<div class="projects">
    {
        projects.map((project, projectIdx) => (
            <div class="project">
                {
                    project.gallery.map((_slide, slideIdx) => {
        const x = null;

        return <div class="slide"></div>;
    })
                }
            </div>
        ))
    }
</div>

<!-- expected similar behavior (tested using typescript formatter in .tsx file): -->

<!-- <div class="projects">
    {projects.map((project, projectIdx) => (
        <div class="project">
            {project.gallery.map((_slide, slideIdx) => {
                const x = null;

                return <div class="slide"></div>;
            })}
        </div>
    ))}
</div> -->
g-plane commented 2 weeks ago

Please provide a minimal reproduction, instead of a large config and a large input file.

predaytor commented 2 weeks ago

updated