diff --git a/.changeset/five-seahorses-taste.md b/.changeset/five-seahorses-taste.md new file mode 100644 index 0000000..94f1a3c --- /dev/null +++ b/.changeset/five-seahorses-taste.md @@ -0,0 +1,5 @@ +--- +'esrap': patch +--- + +fix: `context.multiline` now bubbles up through child-contexts diff --git a/src/context.js b/src/context.js index d264282..3f59d20 100644 --- a/src/context.js +++ b/src/context.js @@ -1,4 +1,3 @@ -/** @import { TSESTree } from '@typescript-eslint/types' */ /** @import { BaseNode, Command, Visitors } from './types' */ export const margin = 0; @@ -51,7 +50,7 @@ export class Context { append(context) { this.#commands.push(context.#commands); - if (this.#has_newline) { + if (this.#has_newline || context.multiline) { this.multiline = true; } }