Skip to content

Feature request: [tl! hide] (proposed solution to prettier moving comments) #4

Description

@michael-mcgreal

Being able to use prettier to format code snippets before passing them to torchlight is a dream!

However, I've been regularly encountering a case where prettier moves my comment to a new line, changing which line torchlight highlights.

const fn = () => (
  <div> // [tl! highlight]
    <div></div>
  </div>
)

Which prettier formatting transforms to:

const fn = () => (
  <div>
    {' '}
    // [tl! highlight]
    <div></div>
  </div>
)

(With the [tl! highlight] is moved to a new line)

Does anyone have tips on how to prevent prettier from doing this? Or workarounds?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions