prettier-plugin-laravel-blade 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prettier-plugin-laravel-blade",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "Prettier plugin for Laravel Blade templates, powered by a real AST parser",
5
5
  "author": "Helge Sverre <helge.sverre@gmail.com>",
6
6
  "license": "MIT",
package/src/index.mjs CHANGED
@@ -53,6 +53,9 @@ export const parsers = {
53
53
  attributeSort: options.bladeAttributeSort,
54
54
  closingBracketStyle: options.bladeClosingBracketStyle,
55
55
  selfClosingStyle: options.bladeSelfClosingStyle,
56
+ htmlBlockSpacing: options.bladeHtmlBlockSpacing,
57
+ echoSpacing: options.bladeEchoSpacing,
58
+ trailingNewline: options.bladeTrailingNewline,
56
59
  };
57
60
 
58
61
  // Pass cursor offset if set
@@ -233,6 +236,37 @@ export const options = {
233
236
  { value: "never", description: "Use explicit close tags" },
234
237
  ],
235
238
  },
239
+ bladeHtmlBlockSpacing: {
240
+ type: "choice",
241
+ category: "Blade",
242
+ default: "between_blocks",
243
+ description: "Blank lines between block-level HTML element siblings.",
244
+ choices: [
245
+ {
246
+ value: "between_blocks",
247
+ description: "Add blank line between block elements",
248
+ },
249
+ { value: "none", description: "No blank lines between block elements" },
250
+ { value: "preserve", description: "Preserve original spacing" },
251
+ ],
252
+ },
253
+ bladeEchoSpacing: {
254
+ type: "choice",
255
+ category: "Blade",
256
+ default: "spaced",
257
+ description: "Spacing inside echo braces {{ }} and {!! !!}.",
258
+ choices: [
259
+ { value: "spaced", description: "Always add spaces: {{ $var }}" },
260
+ { value: "compact", description: "No spaces: {{$var}}" },
261
+ { value: "preserve", description: "Preserve original spacing" },
262
+ ],
263
+ },
264
+ bladeTrailingNewline: {
265
+ type: "boolean",
266
+ category: "Blade",
267
+ default: true,
268
+ description: "Add a trailing newline at the end of formatted output.",
269
+ },
236
270
  };
237
271
 
238
272
  /** @type {Record<string, any>} */