Skip to content

Commit 8eaf4a3

Browse files
committed
feat: introduce experimental option 'experimentalMethodChainIndentation'
1 parent 90990bb commit 8eaf4a3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ const options = {
103103
category: "Global",
104104
default: false,
105105
description: "Output the Twig block name in the 'endblock' tag"
106+
},
107+
experimentalMethodChainIndentation: {
108+
type: "boolean",
109+
category: "Global",
110+
default: false,
111+
description: "Experimental: Fix indentation for chained method call"
106112
}
107113
};
108114

tests/Experimental/experimental.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import { describe, expect, it } from "vitest";
44
describe("Experimental", () => {
55
it("Properly indent chain method", async () => {
66
const { actual, snapshotFile } = await run_spec(import.meta.url, {
7-
source: "chain_indentation.twig"
7+
source: "chain_indentation.twig",
8+
formatOptions: {
9+
experimentalMethodChainIndentation: true
10+
}
811
});
912
await expect(actual).toMatchFileSnapshot(snapshotFile);
1013
});

0 commit comments

Comments
 (0)