@prettier/plugin-pug
Advanced tools
Comparing version 1.1.3 to 1.1.4
# Next | ||
[diff](https://github.com/prettier/plugin-pug/compare/1.1.3...master) | ||
[diff](https://github.com/prettier/plugin-pug/compare/1.1.4...master) | ||
# 1.1.4 | ||
[diff](https://github.com/prettier/plugin-pug/compare/1.1.3...1.1.4) | ||
- Fix wrapping of framework bindings ([#61]) | ||
[#61]: https://github.com/prettier/plugin-pug/issues/61 | ||
# 1.1.3 | ||
@@ -6,0 +14,0 @@ |
{ | ||
"name": "@prettier/plugin-pug", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Prettier Pug Plugin", | ||
@@ -34,7 +34,7 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/jest": "~24.0.25", | ||
"@types/node": "~13.1.6", | ||
"@types/jest": "~24.9.0", | ||
"@types/node": "~13.1.7", | ||
"@types/prettier": "~1.19.0", | ||
"@typescript-eslint/eslint-plugin": "~2.15.0", | ||
"@typescript-eslint/parser": "~2.15.0", | ||
"@typescript-eslint/eslint-plugin": "~2.16.0", | ||
"@typescript-eslint/parser": "~2.16.0", | ||
"eslint": "~6.8.0", | ||
@@ -41,0 +41,0 @@ "eslint-config-prettier": "~6.9.0", |
@@ -78,2 +78,11 @@ import { Doc, FastPath, format, Options, Parser, ParserOptions, Plugin, util } from 'prettier'; | ||
function unwrapLineFeeds(value: string): string { | ||
return value.includes('\n') | ||
? value | ||
.split('\n') | ||
.map((part) => part.trim()) | ||
.join('') | ||
: value; | ||
} | ||
export const plugin: Plugin = { | ||
@@ -154,3 +163,7 @@ languages: [ | ||
const codeInterpolationOptions = { singleQuote: !singleQuote, printWidth: 9000 }; | ||
const codeInterpolationOptions: Options = { | ||
singleQuote: !singleQuote, | ||
printWidth: 9000, | ||
endOfLine: 'lf' | ||
}; | ||
@@ -298,2 +311,3 @@ if (tokens[0]?.type === 'text') { | ||
}); | ||
val = unwrapLineFeeds(val); | ||
const quotes: "'" | '"' = singleQuote ? "'" : '"'; | ||
@@ -309,2 +323,3 @@ val = `${quotes}${val}${quotes}`; | ||
}); | ||
val = unwrapLineFeeds(val); | ||
const quotes: "'" | '"' = singleQuote ? "'" : '"'; | ||
@@ -311,0 +326,0 @@ val = `${quotes}${val}${quotes}`; |
Sorry, the diff of this file is too big to display
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
136549
2092