Loading ...
Sorry, an error occurred while loading the content.

var declaration indentation

Expand Messages
  • Erik Eckhardt
    JSLint supports var statement indenting in a variety of ways (see fn1, fn2, and fn3). Would you consider adding support for the method as shown by fn4? For
    Message 1 of 1 , Jul 25, 2011
    View Source
    • 0 Attachment
      JSLint supports var statement indenting in a variety of ways (see fn1, fn2,
      and fn3).


      Would you consider adding support for the method as shown by fn4? For
      complicated chains I would like the declared variables to line up (e.g., a
      with b) but also indent the chained methods.


      Thank you,


      Erik


      ---------------------------


      function remotefn() {

      ___// return something;

      }



      function fn1(x, y) {

      ___var a = remotefn()

      ______.enqueue(x),

      ______b = remotefn()

      ______.enqueue(y);

      ___return [a, b];

      }



      function fn2(x, y) {

      ___var a = remotefn()

      _________.enqueue(x),

      ______b = remotefn()

      _________.enqueue(y);

      ___return [a, b];

      }



      function fn3(x, y) {

      ___var

      ______a = remotefn()

      ______.enqueue(x),

      ______b = remotefn()

      ______.enqueue(y);

      ___return [a, b];

      }



      function fn4(x, y) {

      ___var

      ______a = remotefn()

      _________.enqueue(x),

      ______b = remotefn()

      _________.enqueue(y);

      ___return [a, b];

      }



      Please note these are entirely fabricated examples and aren't doing anything
      useful or otherwise sensible except for declaring variables and using them
      somehow so JSLint shows only the error of interest.


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.