0.5.4 • Published 5 years ago

@orlov_vo/prettier-plugin-svelte v0.5.4

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

Prettier for Svelte 3 components

Format your svelte components using prettier.

Features

  • Format your html, css, and javascript using prettier
  • Format Svelte syntax, e.g. each loops, if statements, await blocks, etc.
  • Format the javascript expressions embedded in the svelte syntax
    • e.g. expressions inside of {}, event bindings on:click="", and more

Different from original

This fork:

  • Doesn't collapse non-closable tags like <div></div>
  • Have "true" order in components: scripts, template, styles
  • Generate valid attributes (example: <div bind:value="{myValue}"></div>)

How to use

Install @orlov_vo/prettier-plugin-svelte as a dev dependency in your project.

npm install --save-dev @orlov_vo/prettier-plugin-svelte

Then format your code using prettier cli. You may need to add --plugin-search-dir=.

prettier --write --plugin-search-dir=. ./**/*.html

Options

sort-order Sort order for scripts, html, and css. Defaults to scripts-css-html.

prettier --write --sort-order scripts-html-css ./**/*.svelte
0.5.4

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.4.0

5 years ago

0.2.0

5 years ago