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

Re: Line breaking errors

Expand Messages
  • Douglas Crockford
    ... I agree. So I have changed the way JSLint looks at line breaking. It is now specifically concerned with infix operators, comma, and semicolon, and is more
    Message 1 of 2 , Apr 16, 2009
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "Jakob Kruse" <kruse@...> wrote:
      > What's the rationale behind issuing a line breaking error for code like this:
      >
      > var x = somefunc(
      > param1,
      > param2
      > );
      >
      > But not for code like this:
      >
      > var x = {
      > property1: value1,
      > property2: value2
      > };
      >
      > The error forces me to move the ");" one line up in the first case. That's counter-intuitive and doesn't read well. It does guard against the missing/extra comma error when adding more lines, but that should be the same for the two examples.


      I agree. So I have changed the way JSLint looks at line breaking. It is now specifically concerned with infix operators, comma, and semicolon, and is more forgiving of other cases.

      This was a fairly large change, so please let me know if you see cases where it is too loose or unreasonably strict.
    Your message has been successfully submitted and would be delivered to recipients shortly.