Socket
Socket
Sign inDemoInstall

prettier-plugin-svelte

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-svelte - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

5

CHANGELOG.md
# prettier-plugin-svelte changelog
## 1.4.0
* Fix print order of attributes and body ([#146](https://github.com/sveltejs/prettier-plugin-svelte/issues/146))
* Support the new `{#key}` block introduced in Svelte 3.28.0 ([#147](https://github.com/sveltejs/prettier-plugin-svelte/pull/147))
## 1.3.0

@@ -4,0 +9,0 @@

4

package.json
{
"name": "prettier-plugin-svelte",
"version": "1.3.0",
"version": "1.4.0",
"description": "Svelte plugin for prettier",

@@ -39,3 +39,3 @@ "main": "plugin.js",

"rollup-plugin-typescript": "1.0.0",
"svelte": "^3.20.0",
"svelte": "^3.28.0",
"ts-node": "^7.0.1",

@@ -42,0 +42,0 @@ "tslib": "^1.9.3",

@@ -558,2 +558,4 @@ 'use strict';

selfClosingTags.indexOf(node.name) !== -1);
// Order important: print attributes first
const attributes = path.map((childPath) => childPath.call(print), 'attributes');
let body;

@@ -585,3 +587,3 @@ if (isEmpty) {

: '',
...path.map((childPath) => childPath.call(print), 'attributes'),
...attributes,
options$$1.svelteBracketNewLine

@@ -719,2 +721,12 @@ ? dedent(isSelfClosingTag ? line : softline)

}
case 'KeyBlock': {
const def = [
'{#key ',
printJS(path, print, 'expression'),
'}',
printIndentedWithNewlines(path, print),
];
def.push('{/key}');
return concat([group(concat(def)), breakParent]);
}
case 'ThenBlock':

@@ -874,3 +886,3 @@ case 'PendingBlock':

if (!isPreformat) {
if ((!childDoc || !fromNode || canBreakBefore(fromNode))) {
if (!childDoc || !fromNode || canBreakBefore(fromNode)) {
linebreakPossible();

@@ -877,0 +889,0 @@ const lastChild = childDocs[childDocs.length - 1];

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc