0

JSCS has a disallowMultipleLineBreaks rule. This asserts that there is no more than 1 line break between statements in JavaScript. I would like to allow 2 line breaks between method declarations, but no more than 2. I'd also like to disallow more than 1 line break between statements that are not method declarations. An example:

module.exports = {
  foo : function () { },


  // ok
  bar : function () {},

  baz : function () {
    const QUX = 'QUX'


    // not ok
  }
}

Is this possible in either ESLint or JSCS?

james_womack
  • 10,028
  • 6
  • 55
  • 74
  • 1
    Here is the appropriate rule from eslint: http://eslint.org/docs/rules/no-multiple-empty-lines .... But its very generic and not very specific like you want. – Gyandeep Dec 16 '15 at 21:17
  • @Gyandeep That's at least better than what I have been using. If you post that as an answer I will accept it. – james_womack Dec 23 '15 at 23:43

1 Answers1

0

Here is the appropriate rule from ESLint: http://eslint.org/docs/rules/no-multiple-empty-lines ....

But its very generic and not very specific like you want.

Gyandeep
  • 12,726
  • 4
  • 31
  • 42