Files
tsgo/testdata/tests/cases/compiler/optionalChainingArrowFunctionCommentEs2018.ts
aeff766c31 Preserve comments when downleveling arrow expression bodies (#4723)
Co-authored-by: Jake Bailey <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
2026-08-19 20:30:16 +00:00

23 lines
618 B
TypeScript

// @target: es2018
const thing = { nested: { condition: true } };
const wat = () =>
// explanatory comment
thing?.nested?.condition ? "pass" : "fail";
const watInline = () => /* inline explanatory comment */ thing?.nested?.condition ? "pass" : "fail";
const watInlineMultiline = () => /* inline
explanatory comment */ thing?.nested?.condition ? "pass" : "fail";
const watInlineThenLeading = () => /* inline explanatory comment */
// leading explanatory comment
thing?.nested?.condition ? "pass" : "fail";
declare const o: { a?: number[] };
export const f = () =>
// comment
o.a?.length;