Glavin001 / atom-beautify

:mega: Help Wanted - Looking for Maintainer: https://github.com/Glavin001/atom-beautify/issues/2572 | :lipstick: Universal beautification package for Atom editor (:warning: Currently migrating to https://github.com/Unibeautify/ and have very limited bandwidth for Atom-Beautify Issues. Thank you for your patience and understanding :heart: )
http://unibeautify.com/
MIT License
1.5k stars 453 forks source link

Get along with .svelte #2584

Open pbrilius opened 3 years ago

pbrilius commented 3 years ago

Description

Can you please add support for svelte.js?

Input Before Beautification

This is what the code looked like before:

<script>
  import { totalNotesStore } from "./total-notes-store.js";
  import { onDestroy } from "svelte";

  let totalNotesData = [];

  totalNotesStore.subscribe((value) => {
    totalNotesData = value;
  });

  const unsubscribe = totalNotesStore.subscribe((data) => {
    totalNotesData = data;
  });

  onDestroy(unsubscribe);
</script>

<p class="fs-5">
  <span class="fw-bolder">Total</span> User
  <span class="fst-italic">Notes:</span>
  {#if $totalNotesStore}
    {#each $totalNotesStore as item}{item.totalPayments}{/each}
  {/if}
</p>

Expected Output

The beautified code should have looked like this:

<INSERT CODE HERE>

Actual Output

The beautified code actually looked like this:

<script>
  import { totalNotesStore } from "./total-notes-store.js";
  import { onDestroy } from "svelte";

  let totalNotesData = [];

  totalNotesStore.subscribe((value) => {
    totalNotesData = value;
  });

  const unsubscribe = totalNotesStore.subscribe((data) => {
    totalNotesData = data;
  });

  onDestroy(unsubscribe);
</script>

<p class="fs-5">
  <span class="fw-bolder">Total</span> User
  <span class="fst-italic">Notes:</span>
  {#if $totalNotesStore}
    {#each $totalNotesStore as item}{item.totalPayments}{/each}
  {/if}
</p>

Steps to Reproduce

  1. Add code to Atom editor
  2. Run command Atom Beautify: Beautify Editor
  3. This beautified code does not look right!

Debug

Here is a link to the debug.md Gist:

Checklist

I have: