Skip to content

svelte template pug format remove line break ( and add 2 indent ) #482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
i18nsite opened this issue Jan 26, 2025 · 0 comments · May be fixed by #483
Open

svelte template pug format remove line break ( and add 2 indent ) #482

i18nsite opened this issue Jan 26, 2025 · 0 comments · May be fixed by #483

Comments

@i18nsite
Copy link

i18nsite commented Jan 26, 2025

svelte template pug format remove line break ( and add 2 init indent )

how to add the line break add remove init indent?

❯ cat Test2.svelte
<template lang="pug">
h1(b="1" x="x") 33
+if name
  button(@click=add) Hello {name}
</template>

->

❯ bun x prettier ./Test2.svelte
<template lang="pug">
  h1(b="1" x="x") 33
  +if name
    button(@click=add) Hello {name}</template>

<script lang="coffee">
> svelte > tick

name = 1

add = =>
  ++name
  return
</script>

<style>
button {
  color: #ff3e00;
}
h3 {
  color: #000;
}
</style>

❯ cat ../../package.json
{
  "type": "module",
  "dependencies": {
    "$": "link:../srv/gen/js",
    "@3-/svelte-com": "link:../../i18n/lib/svelte-com",
    "@3-/coffee_plus": "^0.1.15",
    "@3-/jsext": "^0.0.7",
    "@3-/loader": "^0.0.2",
    "svelte": "^5.19.3",
    "vite": "^6.0.11",
    "zx": "^8.3.0"
  },
  "devDependencies": {
    "@prettier/plugin-pug": "^3.2.0",
    "prettier-plugin-svelte": "^3.3.3",
    "prettier-plugin-toml": "^2.0.1"
  }
}
❯ cat ../../.prettierrc.yml
endOfLine: lf
pugAttributeSeparator: none
pugEmptyAttributes: none
pugSortAttributes: asc
svelteAllowShorthand: true
svelteIndentScriptAndStyle: false
svelteSortOrder: options-markup-scripts-styles
plugins:
  - prettier-plugin-svelte
  - "@prettier/plugin-pug"
overrides:
  - files: "*.svelte"
    options:
      parser: svelte
@i18nsite i18nsite linked a pull request Jan 26, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
@i18nsite and others