Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pragmatic and widely agreed settings for jshint

Tags:

jslint

jshint

We're just starting to use JSHint / JSLint and are looking for some "best practice" type settings that are widely considered to be a good compromise between strictness and pragmatism. I've had a look on the internet and not really been able to find anything.

I realise it's all down to personal opinion but I would have thought that some sort of consensus would have formed by now. For example does anybody know what jquery, google, yahoo etc code to?

Thanks.

like image 605
cedd Avatar asked Nov 07 '12 15:11

cedd


1 Answers

It definitely is a matter of personal style, but you can see many examples from open source projects:

  • jQuery or jQuery UI
  • Mozilla browserid
  • yeti (from Yahoo yui)

So if you pragmatically combine them you get something like that:

{
    "curly": true,
    "eqeqeq": true,
    "eqnull": true,
    "expr": true,
    "latedef": true,
    "onevar": true,
    "noarg": true,
    "node": true,
    "trailing": true,
    "undef": true,
    "unused": true
}
like image 153
Odi Avatar answered Nov 07 '22 17:11

Odi