SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    911
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    jshint.com vs jslint.com ?

    Which is better and why?

    Thanks in advance.
    I Love coding...
    Don't click this link.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,608
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    jslint.com was created by someone who has actually had some of their suggestions for improvents to JavaScript incorporated into the language (eg the JSON object).

    jshint.com appears to be an open source copy of jslint.com
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    911
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    @felgall ;
    Nice information.

    So in conclusion jshint is much better.

    Thanks dude.
    I Love coding...
    Don't click this link.

  4. #4
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,155
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    More specifically, jslint was created by Doug Crockford, and although he's very smart and knowledgeable, he's also very dogmatic, and that's reflected in jslint, which has several of Crockford's coding rules baked into the linter. jshint is a fork of jslint, but made to be more configurable. These days, I think jshint is the better tool.
    "First make it work. Then make it better."

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,608
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Jeff Mott View Post
    has several of Crockford's coding rules baked into the linter
    Those particular rules are there because of the errors that sometimes occur if you don't apply those rules.

    Douglas Crockford has been known to modify the script to build in additional rules once it is made clear to him that without the rule that the code is error prone.

    In other words he's dogmatic for good reasons and being able to turn off rules where jslint doesn't provide an option for doing so is not necessarily a good thing.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,358
    Mentioned
    179 Post(s)
    Tagged
    9 Thread(s)
    Here's a little bit more on why Anton Kovalyov forked JSLint to JSHint: http://anton.kovalyov.net/2011/02/20...int-to-jshint/

    It seems to me that JSLint is generally a little more lenient (or at least configurable or agnostic) on a few stylistic and minor syntactical "opinions" that JSLint (i.e. Mr Crockford) is a stickler on.
    http://stackoverflow.com/questions/6...ipt-validation

  7. #7
    Under Construction silver trophybronze trophy AussieJohn's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    776
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    JSHint is my preferred linter because of its configurability and tendency to be a little more lenient. In general the things I tell it to be lenient about are not things that would break anything if they were not adhered to (such as indentation/whitespace rules, type of quotes used, etc.)
    var details = {
    . . web: "afterlight.com.au",
    . . photos: "jvdl.id.au",
    . . psa: "usethelatestversion.com"
    }


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •