prettier-plugin-svelte
Advanced tools
Comparing version 1.3.0 to 1.4.0
# 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 @@ |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138434
1211