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

JSLint: Unexpected Space Errors Question

Expand Messages
  • speedomodel@rocketmail.com
    JSLint produces Unexpected space errors for the following: var myArray = [ 1 , 2 , 3 ]; Shouldn t having Tolerate sloppy line breaking on allow for this?
    Message 1 of 2 , Apr 24 2:55 PM
    View Source
    • 0 Attachment
      JSLint produces "Unexpected space" errors for the following:

      var myArray = [ 1
      , 2
      , 3
      ];

      Shouldn't having "Tolerate sloppy line breaking" on allow
      for this? Maybe it's poor style on my part, but I typically
      code long lists with a comma on the next line for
      readability. Thanks.
    • Douglas Crockford
      ... I never imagined that someone would insert a line break before a comma. But I agree that Tolerate sloppy should allow it. It does now.
      Message 2 of 2 , Apr 25 2:43 PM
      View Source
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "speedomodel@..." <speedomodel@...> wrote:
        >
        > JSLint produces "Unexpected space" errors for the following:
        >
        > var myArray = [ 1
        > , 2
        > , 3
        > ];
        >
        > Shouldn't having "Tolerate sloppy line breaking" on allow
        > for this? Maybe it's poor style on my part, but I typically
        > code long lists with a comma on the next line for
        > readability. Thanks.

        I never imagined that someone would insert a line break before a comma. But I agree that "Tolerate sloppy" should allow it. It does now.
      Your message has been successfully submitted and would be delivered to recipients shortly.