Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prettier-plugin-svelte

Package Overview
Dependencies
Maintainers
2
Versions
60
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.4.1 to 1.4.2

5

CHANGELOG.md
# 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 @@

4

package.json
{
"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

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