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

Double indentation

Expand Messages
  • Erik Eckhardt
    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 =
    Message 1 of 2 , Apr 1 5:18 PM
    View Source
    • 0 Attachment
      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]
    • 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 2 of 2 , Apr 8 10:51 AM
      View Source
      • 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.