Skip to content

[CS2] Rewriter: Inline block comments in CSX not getting output #4629

@microdou

Description

@microdou

JSX has a comment syntax {/* */}:

<div> {/* A JSX comment */} </div>

<div>
{/* 
  Multiline
  JSX comment
*/}
</div>

Currently there is no corresponding comment syntax in CSX yet. However, a workaround does exist, by using {`/* */`}:

# CSX
<div> {`/* A JSX comment */`} </div>
<div>
{`/* 
  Multiline
  JSX comment
*/`}
</div>

# converts to JSX
<div> {/* A JSX comment */} </div>;
<div>
{/* 
  Multiline
  JSX comment
*/}
</div>;

Should this workaround be documented, or implement a specific comment syntax for CSX?
It can be {### ###} or {# } or something else. There was some discussion on this topic in the depreciated CJSX jsdf/coffee-react-transform#41, and CJSX actually implemented the syntax {# }.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions