naugtur
naugtur

Reputation: 16915

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]

Upvotes: 7

Views: 8229

Answers (3)

max4ever
max4ever

Reputation: 12142

You can install Komodo Edit (open source editor) and use its configuration tool for JsLint or JsHint, here is how for JsLint:

enter image description here

which gives you the config string

enter image description here

Upvotes: 0

penartur
penartur

Reputation: 9912

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).

Upvotes: 1

elclanrs
elclanrs

Reputation: 94101

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 */

Upvotes: 5

Related Questions