peopledoc / eslint-config-peopledoc

ESLint config for PeopleDoc frontend projects
MIT License
1 stars 1 forks source link

Refactor: Do not force empty lines between single line class members #54

Closed KamiKillertO closed 4 years ago

KamiKillertO commented 4 years ago

A small patch to fix annoying lint errors due to the config of the rule lines-between-class-members. With the current config of this rule, we are not allowed to write something like this:

class Foo {
  bar = true
  fizz = false
  buzz = true
}

Instead, we have to write this:

class Foo {
  bar = true

  fizz = false

  buzz = true
}

Which is a little bit annoying.

This PR update the config for this rule to don't force an empty line between class members that are in one single line.

Example:

class Foo {
  bar = true
  fizz = false
  buzz = true // new line is not mandatory here

  toString() { // New line is mandatory here
    return `bar: ${this.bar}, fizz: ${this.fizz}, buzz: ${this.buzz}`
  }
}