@zackad/prettier-plugin-twig 0.12.0 → 0.13.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/README.md CHANGED
@@ -56,7 +56,7 @@ If set to `true`, objects will always be wrapped/broken, even if they would fit
56
56
  ></section>
57
57
  ```
58
58
 
59
- If set to `false` (default value), this would be printed as:
59
+ If set to `false`, this would be printed as:
60
60
 
61
61
  ```html
62
62
  <section class="{{ { base: css.prices } | classes }}"></section>
package/package.json CHANGED
@@ -1,15 +1,21 @@
1
1
  {
2
2
  "name": "@zackad/prettier-plugin-twig",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Prettier Plugin for Twig",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/zackad/prettier-plugin-twig.git"
8
8
  },
9
+ "funding": "https://github.com/zackad/prettier-plugin-twig?sponsor=1",
9
10
  "license": "Apache-2.0",
10
11
  "author": "Tom Bartel <thomas.bartel@trivago.com>",
11
12
  "type": "module",
12
- "exports": "./src/index.js",
13
+ "exports": {
14
+ ".": {
15
+ "default": "./src/index.js"
16
+ },
17
+ "./package.json": "./package.json"
18
+ },
13
19
  "files": [
14
20
  "src"
15
21
  ],
@@ -23,8 +29,7 @@
23
29
  "@babel/types": "^7.24.9",
24
30
  "he": "^1.2.0",
25
31
  "lodash": "^4.17.21",
26
- "prettier": "^3.0.0",
27
- "resolve": "^1.12.0"
32
+ "prettier": "^3.0.0"
28
33
  },
29
34
  "devDependencies": {
30
35
  "eslint": "^8.56.0",
@@ -290,6 +290,14 @@ export const BinaryNullCoalesceExpression = createBinaryOperatorNode({
290
290
  precedence: 300,
291
291
  associativity: LEFT
292
292
  });
293
+
294
+ // Ref: https://plugins.craftcms.com/empty-coalesce
295
+ export const BinaryEmptyCoalesceExpression = createBinaryOperatorNode({
296
+ text: "???",
297
+ type: "BinaryEmptyCoalesceExpression",
298
+ precedence: 300,
299
+ associativity: LEFT
300
+ });
293
301
  //endregion
294
302
 
295
303
  //region Test Expressions
@@ -16,7 +16,7 @@ const printOpeningTag = (node, path, print) => {
16
16
  const hasAttributes = node.attributes && node.attributes.length > 0;
17
17
 
18
18
  if (hasAttributes) {
19
- return [opener, indent([" ", printedAttributes]), openingTagEnd];
19
+ return [opener, indent([line, printedAttributes]), openingTagEnd];
20
20
  }
21
21
  return [opener, openingTagEnd];
22
22
  };