Recommended jslint configuration?

JSlint allows you to set parameters in the comment block at the beginning of your script, and some of them can help make it less annoying to use. I hope for better performance.

I selected them to start with:

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

What are the defaults set?

[I'm really trying to make it NOT subjective, but yes, I want to know what works for you]

+6
source share
3 answers

It basically works for me, turned off all the annoying things.

 /*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 */ 
+5
source

What do you mean by less annoying to use? Do not use JSLint is the least annoying.

By default, the default values ​​are set in JSLint; thus, the default values ​​are "no overrides". However, in some cases, you need to override the default values; for you, it could be browser: true (so that javascript can interact with the browser) and devel: true (if you want to use alert , console.log , etc .; btw, use the built-in browser debugger instead).

+1
source

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

enter image description here

which gives you the configuration line

enter image description here

0
source

Source: https://habr.com/ru/post/915134/


All Articles