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

Re: Double indentation

Expand Messages
  • abyssoft@ymail.com
    I have found that wrapping complex or intermediates in parens makes JSLint happy, also if I am doing a stacked var with complex declarations I have found it is
    Message 1 of 2 , Apr 8, 2011
    • 0 Attachment
      I have found that wrapping complex or intermediates in parens makes JSLint happy, also if I am doing a stacked var with complex declarations I have found it is necessary to place each variable on a separate line with indentation.

      var
      i = (
      $('<p></p>')
      .css({width: '100%', height: '200px'})
      ),
      o = (
      $('<div></div>')
      .css(
      {
      position: 'absolute',
      top: '0',
      left: '0',
      visibility: 'hidden',
      width: '200px',
      height: '150px',
      overflow: 'hidden'
      }
      )
      );

      view with fixed font.

      --- In jslint_com@yahoogroups.com, Erik Eckhardt <erik@...> wrote:
      >
      > I turned on strict whitespace and jslint is telling me that the section
      > starting with `position: 'absolute'` should be have one fewer tab stops:
      >
      > var i = $('<p></p>')
      >
      > .css({width: '100%', height: '200px'}),
      >
      > o = $('<div></div>')
      >
      > .css({
      >
      > position: 'absolute',
      >
      > top: '0',
      >
      > left: '0',
      >
      > visibility: 'hidden',
      >
      > width: '200px',
      >
      > height: '150px',
      >
      > overflow: 'hidden'
      >
      > }),
      >
      > w1,
      >
      > h1,
      >
      > w2,
      >
      > h2;
      >
      > Does my indentation need improvement or does the way I've done it make
      > sense?
      >
      > Erik
      >
      >
      > [Non-text portions of this message have been removed]
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.