Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comented lines moved out from brackets #8804

Open
wclr opened this issue Jul 20, 2020 · 1 comment
Open

Comented lines moved out from brackets #8804

wclr opened this issue Jul 20, 2020 · 1 comment
Labels
area:comments Issues with how Prettier prints comments area:function calls lang:javascript Issues affecting JS type:bug Issues identifying ugly output, or a defect in the program

Comments

@wclr
Copy link

wclr commented Jul 20, 2020

Prettier 2.0.5
Playground link

# Options (if any):
--single-quote=true --semi=false

Input:

  state: xs.merge(
      //  stream1$, 
      //  stream2$
  )

Output:

      state: xs
        .merge
        //  stream1$,
        //  stream2$
        ()

Expected behavior:

I would expect that it leave as it should be or something, but not remove commented lines outsed of brackets, because if you want to uncomment something you need to make extra actions.

@alexander-akait alexander-akait added area:comments Issues with how Prettier prints comments lang:javascript Issues affecting JS type:bug Issues identifying ugly output, or a defect in the program labels Jul 21, 2020
@kachkaev
Copy link
Member

kachkaev commented Oct 3, 2022

Replacing method call with a function call moves comments after brackets:

Prettier 2.7.1
Playground link

--parser babel

Input:

x.do(
        //  setDummyWidgetState$,
      //  setDummyChatState$
      )

doX(
        //  setDummyWidgetState$,
      //  setDummyChatState$
      )

Output:

x
  .do
  //  setDummyWidgetState$,
  //  setDummyChatState$
  ();

doX();
//  setDummyWidgetState$,
//  setDummyChatState$

Spotted by @B2o5T in #13579

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:comments Issues with how Prettier prints comments area:function calls lang:javascript Issues affecting JS type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

No branches or pull requests

4 participants