bryanrsmith / eslint-plugin-sort-class-members

An ESLint rule for enforcing consistent ES6 class member order
119 stars 21 forks source link

Comments on the same line are not preserved #87

Open dospunk opened 1 year ago

dospunk commented 1 year ago

If I have a class defined like

class X {
  private something = 1; //this is 1

  somethingelse = 4;
}

And my rules specify that private properties should go under public ones, I'll end up with

class X {
  //this is 1
  somethingelse = 4;
  private something = 1;  
}

I would expect to end up with this

class X {
  somethingelse = 4;
  private something = 1;  //this is 1
}