JSLINT (JavaScript Lint)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Douglas Crockford

    JSLINT (JavaScript Lint)

    JSLINT now includes a list of member names in its report, along with the
    number of occurences of each member name. This is intended to make it
    easier to find misspellings.

    JSLINT takes a JavaScript source and scans it. If it finds a problem, it
    returns a message describing the problem and an approximate location
    within the source. The problem is not necessarily an error, although it
    often is. JSLINT looks at some style conventions as well as structural
    problems. It does not prove that your program is correct. It just
    provides another set of eyes to help spot problems.

    JSLINT defines a professional subset of JavaScript, a stricter language
    than that defined by Edition 3 of the ECMAScript Language Specification.


  • spark

    #2
    Re: JSLINT (JavaScript Lint)

    In article <beceb$4229e35a $4365967f$24602 @msgid.meganews servers.com>,
    nospam@covad.ne t says...[color=blue]
    > JSLINT now includes a list of member names in its report, along with the
    > number of occurences of each member name. This is intended to make it
    > easier to find misspellings.[/color]

    Hey Doug, I just wanted to thank you for this app. I just went to your
    site and tested a snippet of code and improved it by two semi-colon line
    endings! And I'm impressed that it works as a web app. Maybe I'm
    easily impressed, maybe not, I'm too much of a webapp newbie to know,
    but my book says Pretty Darn Cool.

    I'll be using this a lot. Thanks again!

    spark

    Comment

    • Ulrik Skovenborg

      #3
      Re: JSLINT (JavaScript Lint)

      Douglas Crockford wrote:[color=blue]
      > JSLINT now includes a list of member names in its report, along with the
      > number of occurences of each member name. This is intended to make it
      > easier to find misspellings.[/color]

      This may (or should) be a new question but when I used your JSLINT
      (which is quite a nice tool) it said that the post-increment operator
      was not allowed in my for-loop:
      (i=0;i<somethin g.length;i++) {
      When I read your documentation it said that this was some kind of
      security issue - but how is that? I never really thought that this
      operator was considered bad coding or anything - merely a little quick
      shortcut. Or is it just me?

      Skovenborg

      Comment

      • Douglas Crockford

        #4
        Re: JSLINT (JavaScript Lint)

        >> JSLINT now includes a list of member names in its report, along with[color=blue][color=green]
        >> the number of occurences of each member name. This is intended to make
        >> it easier to find misspellings.[/color][/color]
        [color=blue]
        > This may (or should) be a new question but when I used your JSLINT
        > (which is quite a nice tool) it said that the post-increment operator
        > was not allowed in my for-loop:
        > for ( i = 0; i < something.lengt h; i++) {
        > When I read your documentation it said that this was some kind of
        > security issue - but how is that? I never really thought that this
        > operator was considered bad coding or anything - merely a little quick
        > shortcut. Or is it just me?[/color]

        The i++ tends to be misused. Most of the buffer overrun bugs that
        Microsoft has been purging from its code base used i++. The ++i is less
        prone to misuse. I like the i += 1 even better. JSLINT looks for errors,
        but it also looks for bad practices that are known to be error prone.


        Comment

        Working...