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

Rationale for latest whitespace changes in jslint?

Expand Messages
  • Robocoder (TM)
    If a multi-line expression contains the ternary operator, the expected indentation level for subsequent lines has increased. http://pastebin.com/T2Prsp8s This
    Message 1 of 2 , Sep 18, 2011
    • 0 Attachment
      If a multi-line expression contains the ternary operator, the expected indentation level for subsequent lines has increased.

      http://pastebin.com/T2Prsp8s

      This affects a lot of our code that previously "passed". Why is this considered better?
    • Xavier MONTILLET
      Well JSLint sees if ( a ) { a(); } else { if ( b ) { b( ); } } And you want if ( a ) { a( ); } else if ( b ) { b( ); } It isn t better, just sees it
      Message 2 of 2 , Sep 18, 2011
      • 0 Attachment
        Well JSLint sees

        if ( a ) {
        a();
        } else {
        if ( b ) {
        b( );
        }
        }

        And you want

        if ( a ) {
        a( );
        } else if ( b ) {
        b( );
        }

        It isn't better, just sees it differently.
        Must be a "bug".

        On Sun, Sep 18, 2011 at 4:12 PM, Robocoder (TM) <
        apang@...> wrote:

        > **
        >
        >
        > If a multi-line expression contains the ternary operator, the expected
        > indentation level for subsequent lines has increased.
        >
        > http://pastebin.com/T2Prsp8s
        >
        > This affects a lot of our code that previously "passed". Why is this
        > considered better?
        >
        >
        >


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