prettier-plugin-svelte
Advanced tools
Comparing version 1.4.1 to 1.4.2
# prettier-plugin-svelte changelog | ||
## 1.4.2 | ||
* Pass options to embedded parser ([#162](https://github.com/sveltejs/prettier-plugin-svelte/issues/162)) | ||
* Fall back to raw text if there is a parser error in a JS expression inside a moustache tag ([#163](https://github.com/sveltejs/prettier-plugin-svelte/issues/163)) | ||
## 1.4.1 | ||
@@ -4,0 +9,0 @@ |
{ | ||
"name": "prettier-plugin-svelte", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "Svelte plugin for prettier", | ||
@@ -39,3 +39,3 @@ "main": "plugin.js", | ||
"rollup-plugin-typescript": "1.0.0", | ||
"svelte": "^3.28.0", | ||
"svelte": "^3.30.0", | ||
"ts-node": "^7.0.1", | ||
@@ -42,0 +42,0 @@ "tslib": "^1.9.3", |
@@ -1029,6 +1029,11 @@ 'use strict'; | ||
if (node.isJS) { | ||
return removeLines(textToDoc(forceIntoExpression(getText(node, options)), { | ||
parser: expressionParser, | ||
singleQuote: true, | ||
})); | ||
try { | ||
return removeLines(textToDoc(forceIntoExpression(getText(node, options)), { | ||
parser: expressionParser, | ||
singleQuote: true, | ||
})); | ||
} | ||
catch (e) { | ||
return getText(node, options); | ||
} | ||
} | ||
@@ -1059,4 +1064,4 @@ const embedType = (tag, parser, isTopLevel) => embedTag(tag, path, (content) => formatBodyContent(content, parser, textToDoc, options), print, isTopLevel); | ||
} | ||
function expressionParser(text, parsers) { | ||
const ast = parsers.babel(text); | ||
function expressionParser(text, parsers, options) { | ||
const ast = parsers.babel(text, parsers, options); | ||
return Object.assign({}, ast, { program: ast.program.body[0].expression }); | ||
@@ -1063,0 +1068,0 @@ } |
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
139449
1203