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

Unstable comments in interfaces #5900

Open
SimenB opened this issue Feb 23, 2019 · 0 comments
Open

Unstable comments in interfaces #5900

SimenB opened this issue Feb 23, 2019 · 0 comments
Labels
area:comments Issues with how Prettier prints comments area:idempotency Issues with re-printing Prettier’s output lang:flow Issues affecting Flow-specific constructs (not general JS issues) lang:typescript Issues affecting TypeScript-specific constructs (not general JS issues) type:bug Issues identifying ugly output, or a defect in the program

Comments

@SimenB
Copy link
Contributor

SimenB commented Feb 23, 2019

Prettier 1.16.4
Playground link

--parser typescript

Input:

interface Jest {
  advanceTimersByTime(msToRun: number): void;    /**
  */
}

interface Jest {
  advanceTimersByTime(msToRun: number): void
  /**
   */;
}

interface Jest {
  advanceTimersByTime(
    msToRun: number
  ): void;
  /**
   */
}

Output:

interface Jest {
  advanceTimersByTime(msToRun: number): void
  /**
   */;
}

interface Jest {
  advanceTimersByTime(
    msToRun: number
  ): void;
  /**
   */
}

interface Jest {
  advanceTimersByTime(msToRun: number): void;
  /**
   */
}

Expected behavior:
For the last state to happen after a single format, not after 3. Note that this affects both Flow and TypeScript parsers - although middle state only happens with typescript. Using Babel parser works correctly after a single format

@j-f1 j-f1 added type:bug Issues identifying ugly output, or a defect in the program area:comments Issues with how Prettier prints comments lang:typescript Issues affecting TypeScript-specific constructs (not general JS issues) lang:flow Issues affecting Flow-specific constructs (not general JS issues) area:idempotency Issues with re-printing Prettier’s output labels Feb 23, 2019
@thorn0 thorn0 changed the title Unstable comment Unstable comments in interfaces Dec 5, 2019
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:idempotency Issues with re-printing Prettier’s output lang:flow Issues affecting Flow-specific constructs (not general JS issues) lang:typescript Issues affecting TypeScript-specific constructs (not general JS issues) type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

No branches or pull requests

2 participants