Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommended jslint config?

JSlint allows setting options in a comment block at the beginning of your script and some of them could help make it less annoying to use. I am hoping for some more productivity.

I picked these to start with:

/*jslint devel: true, browser: true, unparam: true, debug: false, es5: true, white: true, maxerr: 50, indent: 4 */

What are the established defaults?

[I am really trying to make it NOT subjective, but yeah, I want to know what works for you]

like image 349
naugtur Avatar asked May 07 '12 21:05

naugtur


2 Answers

Basically this works for me, disabled all annoying stuff.

/*jslint white: true, browser: true, devel: true, windows: true, forin: true, vars: true, nomen: true, plusplus: true, bitwise: true, regexp: true, sloppy: true, indent: 4, maxerr: 50 */
like image 97
elclanrs Avatar answered Oct 05 '22 23:10

elclanrs


What do you mean by "less annoying for use"? Not using JSLint is the least annoying.

The defaults are already set by default in JSLint; thus, the defaults are "no overrides". However, in some cases you have to override the defaults; for you, that would probably be browser: true (to allow javascript to interact with browser) and devel: true (if you want to use alert, console.log etc; btw, consider using browser's integrated debugger instead).

like image 31
penartur Avatar answered Oct 05 '22 23:10

penartur