Prettier: Unstable comment after `static`

Created on 20 Apr 2017  ·  1Comment  ·  Source: prettier/prettier

class A {
  static
  // comment
  a() {}
}

```js
class A {
static // comment
a() {}
}

```js
class A {
  static a() {} // comment
}

https://prettier.github.io/prettier/#%7B%22content%22%3A%22class%20A%20%7B%5Cn%20%20static%5Cn%20%20%2F%2F%E2%80%81comment%5Cn%20%20a()%20%7B%7D%5Cn%7D%5Cn%5Cnclass%20A%20%7B%5Cn%20%20static%20%2F%2F%E2%80%81comment%5Cn%20%20a()%20%7B%7D%5Cn%7D%5Cn%5Cnclass%20A%20%7B%5Cn%20%20static%20a()%20%7B%7D%20%2F%2F%E2%80%81comment%5Cn%7D%22%2C%22options%22%3A%7B%22printWidth%22%3A80%2C%22tabWidth%22%3A2%2C%22singleQuote%22%3Afalse%2C%22trailingComma%22%3A%22none%22%2C%22bracketSpacing%22%3Atrue%2C%22jsxBracketSameLine%22%3Afalse%2C%22parser%22%3A%22babylon%22%2C%22semi%22%3Atrue%2C%22useTabs%22%3Afalse%2C%22doc%22%3Afalse%7D%7D

comments javascript locked-due-to-inactivity bug

Most helpful comment

This one is unreproducible now.


Prettier 1.10.2
Playground link

Input:

class A {
  static
  // comment
  a() {}
}

class A {
  static // comment
  a() {}
}

class A {
  static a() {} // comment
}

Output:

class A {
  static // comment
  a() {}
}

class A {
  static // comment
  a() {}
}

class A {
  static a() {} // comment
}

Second Output:

✓ Second format is unchanged.

>All comments

This one is unreproducible now.


Prettier 1.10.2
Playground link

Input:

class A {
  static
  // comment
  a() {}
}

class A {
  static // comment
  a() {}
}

class A {
  static a() {} // comment
}

Output:

class A {
  static // comment
  a() {}
}

class A {
  static // comment
  a() {}
}

class A {
  static a() {} // comment
}

Second Output:

✓ Second format is unchanged.
Was this page helpful?
0 / 5 - 0 ratings