b0VIM 7.4^[@j+mikebruce~mike/projects/oss/jshint/jshint/src/options.jsutf-8 3210#"! Utp c [d P`"ik uV j r5 QZadcRJ(! t l T S K  v (  H ~ 1 x + Eih`w'^H~}u(@ * for (key in obj) { * * the example: * is generally safer to always filter inherited properties out as shown in * chain. This behavior can lead to unexpected items in your object so it * properties of an object including those inherited through the prototype * for in statement allows for looping through the names of all of the * This option requires all `for in` loops to filter object's items. The /** es5 : true, */ * @deprecated Use `esversion: 5` instead. * * keywords as object properties. * specification](http://es5.github.io/). This includes allowing reserved * This option enables syntax first defined in [the ECMAScript 5.1 /** es3 : true, */ * @deprecated Use `esversion: 3` instead. * * JavaScript environments. * in older browsers—such as Internet Explorer 6/7/8/9—and other legacy * specification. Use this option if you need your program to be executable * This option tells JSHint that your code needs to adhere to ECMAScript 3 /** futurehostile: true, */ * cause issues when migrating codebases to newer versions of the language. * no effect in contexts where they are not implemented, this practice can * defined in future versions of JavaScript. Although overwriting them has * This option enables warnings about the use of identifiers which are /** eqeqeq : true, */ * by Angus Croll. * JavaScript](http://javascriptweblog.wordpress.com/2011/02/07/truth-equality-and-javascript/) * coercion in JavaScript, we recommend [Truth, Equality and * they are generally safer. If you would like to learn more about type * lead to some unexpected results. The latter don't do any coercion so * `!==`. The former try to coerce values before comparing them which can * This options prohibits the use of `==` and `!=` in favor of `===` and /** curly : true, */ * sleep(); * shuffle(); * while (day) * * `sleep()` is a part of the loop while in reality it is not): * However, in some circumstances, it can lead to bugs (you'd think that * * shuffle(); * while (day) * * the block consists of only one statement, for example: * loops and conditionals. JavaScript allows you to omit curly braces when * This option requires you to always put curly braces around blocks in /** camelcase : true, */ * project](https://github.com/jscs-dev/node-jscs). * check out [the JSCS * If you would like to enforce rules relating to code style, * @deprecated JSHint is limiting its scope to issues of code correctness. * * camelCase style or UPPER_CASE with underscores. * This option allows you to force all variable names to use either /** freeze : true, */ * // -> Warning: Extending prototype of native object: 'Array'. * Array.prototype.count = function (value) { return 4; }; * // jshint freeze:true * * `Array`, `Date` and so on. * This options prohibits overwriting prototypes of native objects such as * /** bitwise : true, */ * programs and quite often `&` is simply a mistyped `&&`. * `|` (OR) and others. Bitwise operators are very rare in JavaScript * This option prohibits the use of bitwise operators such as `^` (XOR), /** enforcing: {exports.bool = {// These are the JSHint boolean options."use strict";adWZt93$! ~/ 7 2   v D =  N  r l V S R   m [ Z *     xJF2 nkj(}; strict: true varstmt: true,exports.noenforceall = {// `enforceall`.// Add options here which should not be automatically enforced by}; trailing: true smarttabs: true, gcl: true, white: true, passfail: true, onevar: true, nomen: true,exports.removed = {}; sloppy : "strict" windows: "wsh", eqeq : "eqeqeq",exports.renamed = {// where the name has been changed but the effect is unchanged// These are JSHint boolean options which are shared with JSLintexports.unstableNames = Object.keys(exports.unstable); .concat(["unstable"]); .concat(Object.keys(exports.bool.environments)) .concat(Object.keys(exports.bool.obsolete)) .concat(Object.keys(exports.bool.enforcing)) .concat(Object.keys(exports.bool.relaxing))exports.validNames = Object.keys(exports.val)}; strict : true eqeqeq : true, // Inverted and renamed, use JSHint name here undef : true, regexp : true, plusplus: true, newcap : true, forin : true, bitwise : true,exports.inverted = {// where the definition in JSHint is opposite JSLint// These are JSHint boolean options which are shared with JSLint}; objspreadrest: true */ * https://github.com/tc39/proposal-object-rest-spread * * > n; // { x: 1, y: 2, a: 3, b: 4 } * > let n = { x, y, ...z }; * > * > properties from a provided object onto the newly created object. * > Spread properties in object initializers copies own enumerable * > * > Spread Properties * > * > z; // { a: 3, b: 4 } * > y; // 2 * > x; // 1 * > let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 }; * > * > their values are copied onto a new object. * > are not already picked off by the destructuring pattern. Those keys and * > Rest properties collect the remaining own enumerable property keys that * > * > Rest Properties * * assignment and spread properties for object literals. From the proposal: * Enable parsing support for rest properties for object destructuring /**exports.unstable = { */ * right to remove or modify them between major version releases. * the presence and behavior of these options is volatile; JSHint reserves the * to the JavaScript language. Just like the language features they describe, * Unstable options allow control for parsing and linting of proposed additions/**}; esversion: 5 */ * syntax. Note that not all browsers implement them. * 6](http://www.ecma-international.org/ecma-262/6.0/index.html) specific * - `6` - To tell JSHint that your code uses [ECMAScriptadi   f5- pQJ*# D < $ # "  } . u n '    K !   ^ 9 2  K 7 0  4FsrjjI},pY<5 * b + c, * [ * * occur: * If one always appends a list item with a comma, this ambiguity cannot * * ].forEach(print); * (d + e) * b + c * [ * * if this was a mistake or an intentional function invocation. * missing comma, no syntax error is thrown, and a linter cannot determine * But if one adds an element to the array and forgets to compensate for the * * ].forEach(print); * b + c * [ * * For example, this code might have worked last Tuesday: * * that the strict usage of semicolons helps prevent. * ambiguities](http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.2) * Now, they help to prevent the same [visual * [#11.1.5](http://www.ecma-international.org/ecma-262/5.1/#sec-11.1.5).) * [#11.1.4](http://www.ecma-international.org/ecma-262/5.1/#sec-11.1.4) and * standardized. (See * commas used to be discouraged, but since ES5 their semantics were * array or object literal. Due to bugs in old versions of IE, trailing * This option warns when a comma is not placed after the last element in an /** enforceall : false, */ * JSHint. * warnings/errors in when upgrading between minor versions of * users in to new features. This can lead to unexpected * @deprecated The option cannot be maintained without automatically opting * * disables all relaxing options that were defined in that release. * available in JSHint version 2.6.3. It enables all enforcing options and * This option is a short hand for the most strict JSHint configuration as /** varstmt: false, */ * var a; // Warning: `var` declarations are forbidden. Use `let` or `const` instead. * * // jshint varstmt: true * * For example: * When set to true, the use of VariableStatements are forbidden. /** singleGroups: false, */ * delete(obj.attr); // Warning: Unnecessary grouping operator. * * // jshint singleGroups: true * * unary operators, for example: * strictly required. Such usage commonly reflects a misunderstanding of * This option prohibits the use of the grouping operator when it is not /** noreturnawait: true, */ * https://jakearchibald.com/2017/await-vs-return-vs-return-await/ * * return vs return await": * within the `try` clause of a TryStatement--for more, see "await vs * result of the asynchronous operation directly. The notable exception is * instance) unnecessary. For clarity, it's often preferable to return the * returning the result of an AwaitExpression (which is itself a Promise * Async functions resolve on their return value. In most cases, this makes /** nonew : true, */ * used anywhere so you should generally avoid constructors like this one. * `MyConstructor` since the object that the operator `new` creates isn't * There is no advantage in this approach over simply calling * * new MyConstructor(); * * result to any variable: * Some people like to call constructor functions without assigning its * This option prohibits the use of constructor functions for side-effects. /** nonbsp : true, */ * potential of breaking non-UTF8 web pages. * characters can be entered with option-space on Mac computers and have a * This option warns about "non-breaking whitespace" characters. Thesead=P`Y924  G "  z 4  u t l   / | t \ [ S  mS2mf{nYB% * b + c, * [ * * occur: * If one always appends a list item with a comma, this ambiguity cannot * * ].forEach(print); * (d + e) * b + c * [ * * if this was a mistake or an intentional function invocation. * missing comma, no syntax error is thrown, and a linter cannot determine * But if one adds an element to the array and forgets to compensate for the * * ].forEach(print); * b + c * [ * * For example, this code might have worked last Tuesday: * * that the strict usage of semicolons helps prevent. * ambiguities](http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.2) * Now, they help to prevent the same [visual * [#11.1.5](http://www.ecma-international.org/ecma-262/5.1/#sec-11.1.5).) * [#11.1.4](http://www.ecma-international.org/ecma-262/5.1/#sec-11.1.4) and * standardized. (See * commas used to be discouraged, but since ES5 their semantics were * array or object literal. Due to bugs in old versions of IE, trailing * This option warns when a comma is not placed after the last element in an /** enforceall : false, */ * JSHint. * warnings/errors in when upgrading between minor versions of * users in to new features. This can lead to unexpected * @deprecated The option cannot be maintained without automatically opting * * disables all relaxing options that were defined in that release. * available in JSHint version 2.6.3. It enables all enforcing options and * This option is a short hand for the most strict JSHint configuration as /** varstmt: false, */ * var a; // Warning: `var` declarations are forbidden. Use `let` or `const` instead. * * // jshint varstmt: true * * For example: * When set to true, the use of VariableStatements are forbidden. /** singleGroups: false, */ * delete(obj.attr); // Warning: Unnecessary grouping operator. * * // jshint singleGroups: true * * unary operators, for example: * strictly required. Such usage commonly reflects a misunderstanding of * This option prohibits the use of the grouping operator when it is not /** undef : true, */ * directive to tell JSHint about it. * If your variable is defined in another file, you can use the `global` * * } * console.log(myvar); // Oops, typoed here. JSHint with undef will complain * var myVar = 'Hello, World'; * function test() { * * // jshint undef:true * * option is very useful for spotting leaking and mistyped variables. * This option prohibits the use of explicitly undeclared variables. This /**ad`|c^POGZ  | u % d   U  K  z F ? % I"fYQ980HA>6< Rj * * } * var x = 0; * if (true) { * function test() { * * warns about variables that are used outside of their intended scope. * the language and hard-to-debug bugs. This is why, by default, JSHint * and function—such practice leads to confusion among people new to * Even though identifiers declared with `var` have two real scopes—global * of control structures while accessing them later from the outside. * This option suppresses warnings about declaring variables inside /** evil : true, */ * interpreter to do certain optimizations. * various injection attacks and it makes it hard for JavaScript * `eval` is discouraged because it can make your code vulnerable to * This option suppresses warnings about the use of `eval`. The use of /** boss : true, */ * for (var i = 0, person; (person = people[i]); i++) {} * * with parenthesis, such as: * You can silence this error on a per-use basis by surrounding the assignment * * for (var i = 0, person; person = people[i]; i++) {} * * 10) {}` is a typo. However, it can be useful in cases like this one: * where comparisons are expected. More often than not, code like `if (a = * This option suppresses warnings about the use of assignments in cases /** debug : true, */ * code. * This option suppresses warnings about the `debugger` statements in your /** multistr : true, */ * project](https://github.com/jscs-dev/node-jscs). * check out [the JSCS * If you would like to enforce rules relating to code style, * @deprecated JSHint is limiting its scope to issues of code correctness. * * World"; // Warning, there is a space after \ * text = "Hello\ * * World"; // Warning, no escape character. * text = "Hello * * World"; // All good. * var text = "Hello\ * * // jshint multistr:true * * anything in between the escape character and a whitespace. * still warns about multi-line strings without escape characters or with * Note that even though this option allows correct multi-line strings, it * * and a new line. * you accidentally put a whitespace in between the escape character (`\`) * strings can be dangerous in JavaScript because all hell breaks loose if * This option suppresses warnings about multi-line strings. Multi-line /** asi : true, */ * Insertion](http://inimino.org/~inimino/blog/javascript_semicolons). * by Isaac Schlueter and [JavaScript Semicolon * Semicolons](http://blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding) * to JavaScript Leaders Regarding * For more information about semicolons in JavaScript read [An Open Letter * * whether you should or should not use semicolons in your code. * which are followed by *all* browsers so it is up to you to decide * not) and that they are unreliable. JavaScript has rules about semicolons * The common myths are that semicolons are required all the time (they are * of FUD about semicolon spread by quite a few people in the community. * This option suppresses warnings about missing semicolons. There is a lot /** relaxing: { }, trailingcomma: false */ * ].forEach(print); * (d + e), * b + c, * [ * * ].forEach(print);ad&izbaY mf;3 } u ] \ S  `  m Y L E v ' y 2 *   yxp 6Z}L HU.zs\? * * }; * , role: 'SW Engineer' * , handle: 'valueof' * name: 'Anton' * var obj = { * * This option suppresses warnings about comma-first coding style: /** laxbreak : true, */ * project](https://github.com/jscs-dev/node-jscs). * check out [the JSCS * If you would like to enforce rules relating to code style, * @deprecated JSHint is limiting its scope to issues of code correctness. * * coding style. To suppress those you have to use `laxcomma` (see below). * breakings in your code. It doesn't suppress warnings about comma-first * This option suppresses most of the warnings about possibly unsafe line /** supernew : true, */ * }; * this.publicMethod2 = function () {} * this.publicMethod = function () {} * * var privateVar; * var singleton = new function() { * * sometimes used to produce singletons in JavaScript: * `new function () { ... }` and `new Object;`. Such constructions are * This option suppresses warnings about "weird" constructions like /** sub : true, */ * project](https://github.com/jscs-dev/node-jscs). * check out [the JSCS * If you would like to enforce rules relating to code style, * @deprecated JSHint is limiting its scope to issues of code correctness. * * expressed in dot notation: `person['name']` vs. `person.name`. * This option suppresses warnings about using `[]` notation when it can be /** scripturl : true, */ * URLs—such as `javascript:...`. * This option suppresses warnings about the use of script-targeted /** proto : true, */ * This option suppresses warnings about the `__proto__` property. /** plusplus : true, */ * Python—that go completely without these operators. * their coding styles and there are programming languages—such as * operators. Some people think that `++` and `--` reduces the quality of * This option prohibits the use of unary increment and decrement /** notypeof : true, */ * these checks. * Do not use this option unless you're absolutely sure you don't want * * } * // ... * if (typeof a == "fuction") { // Invalid typeof value 'fuction' * // 'fuction' instead of 'function' * * value which often can be a typo. * By default, JSHint warns when you compare its result with an invalid * values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof). * This operator has only [a limited set of possible return * This option suppresses warnings about invalid `typeof` operator values. /** iterator : true, */ * property is not supported by all browsers so use it carefully. * This option suppresses warnings about the `__iterator__` property. This /** globalstrict: true, */ * @deprecated Use `strict: "global"`. * * For more info about strict mode see the `strict` option. * * recommended. * Global strict mode can break third-party widgets so it is not * This option suppresses warnings about the use of global strict mode. /** funcscope : true, */ * } * // No warning when funcscope:true * x += 1; // Default: 'x' used out of scope.adE kc<@ a H A } | t & ~ Z  A    i h `  7UN{zr*eH8+$Z=Nx`_W   * This option tells JSHint that your code uses ECMAScript 6 specific /** expr : true, */ * and that's why this warning is optional. * the time, such code is a typo. However, it is not forbidden by the spec * normally you would expect to see assignments or function calls. Most of * This option suppresses warnings about the use of expressions where /** loopfunc : true, */ * } * }(i)); * }; * return i + j; * nums[i] = function (j) { * (function (i) { * for (var i = 0; i < 10; i++) { * * var nums = []; * * To fix the code above you need to copy the value of `i`: * * nums[0](2); // Prints 12 instead of 2 * * } * }; * return i + j; * nums[i] = function (j) { * for (var i = 0; i < 10; i++) { * * var nums = []; * * Defining functions inside of loops can lead to bugs such as this one: * This option suppresses warnings about functions inside of loops. /** lastsemic : true, */ * JavaScript code generators. * This is a very niche use case that is useful only when you use automatic * * var name = (function() { return 'Anton' }()); * * the semicolon is omitted for the last statement in a one-line block: * This option suppresses warnings about missing semicolons, but only when /** eqnull : true, */ * `null` or `undefined`. * comparisons are often useful when you want to check if a variable is * This option suppresses warnings about `== null` comparisons. Such /** noyield : true, */ * `yield` statement in them. * This option suppresses warnings about generator functions with no /** moz : true, */ * 1.7](https://developer.mozilla.org/en-US/docs/JavaScript/New_in_JavaScript/1.7) * * [New in JavaScript * * More info: * * you don't need this option. * extensions. Unless you develop specifically for the Firefox web browser * This options tells JSHint that your code uses Mozilla JavaScript /** withstmt : true, */ * Harmful](http://yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/) * * [with Statement Considered * * More info: * * developers and accidental definition of global variables. * The semantics of the `with` statement can cause confusion among * This option suppresses warnings about the use of the `with` statement. /** validthis : true, */ * globally. * JSHint will fail with an error if you will try to set this option * **Note:** This option can be used only inside of a function scope. * * `Function.call`). * strict mode (for example, if you call your function using * only—when you are positive that your use of `this` is valid in the * non-constructor function. You should use this option—in a function scope * the code is running in strict mode and you use `this` in a * This option suppresses warnings about possible strict violations when /** laxcomma : true, */ * project](https://github.com/jscs-dev/node-jscs). * check out [the JSCS * If you would like to enforce rules relating to code style, * @deprecated JSHint is limiting its scope to issues of code correctness.aduu.'B:" x p X W O ! t l T S K  \ A 9 !   ; ^ V > = 5 PL qiQPHe)! meMLDrqif^FE= * This option defines non-standard but widely adopted globals such as /** worker : true, */ * simple means for web content to run scripts in background threads. * Workers](https://developer.mozilla.org/en/Using_web_workers) provide a * of a Web Worker. [Web * This option defines globals available when your code is running inside /** wsh : true, */ * Host](http://en.wikipedia.org/wiki/Windows_Script_Host). * script for the [Windows Script * This option defines globals available when your code is running as a /** module : true, */ * module. All module code is interpreted as strict mode code. * This option informs JSHint that the input code describes an ECMAScript 6 /** mocha : true, */ * [Mocha unit testing framework](http://mochajs.org/). * This option defines globals exposed by the "BDD" and "TDD" UIs of the /** yui : true, */ * JavaScript framework. * This option defines globals exposed by the [YUI](http://yuilibrary.com/) /** prototypejs : true, */ * [Prototype](http://www.prototypejs.org/) JavaScript framework. * This option defines globals exposed by the /** shelljs : true, */ * library](http://documentup.com/arturadib/shelljs). * This option defines globals exposed by [the ShellJS /** rhino : true, */ * is an open-source implementation of JavaScript written entirely in Java. * of the Rhino runtime environment. [Rhino](http://www.mozilla.org/rhino/) * This option defines globals available when your code is running inside /** qunit : true, */ * framework](http://qunitjs.com/). * This option defines globals exposed by [the QUnit unit testing /** node : true, */ * file-level `use strict` pragmas and `console.log` statements. * in the browser environments but don't make sense in Node such as * event-driven model. This option also skips some warnings that make sense * server-side JavaScript environment that uses an asynchronous * of the Node runtime environment. [Node.js](http://nodejs.org/) is a * This option defines globals available when your code is running inside /** jquery : true, */ * JavaScript library. * This option defines globals exposed by the [jQuery](http://jquery.com/) /** jasmine : true, */ * framework](https://jasmine.github.io/). * This option defines globals exposed by [the Jasmine unit testing /** couch : true, */ * JavaScript. * database that can be queried and indexed in a MapReduce fashion using * [CouchDB](http://couchdb.apache.org/). CouchDB is a document-oriented * This option defines globals exposed by /** mootools : true, */ * [MooTools](http://mootools.net/) JavaScript framework. * This option defines globals exposed by the /** environments: { // Third party globals }, elision : true, */ * or empty elements (for example, `[1, , , 4, , , 7]`). * This option tells JSHint that your code uses ES3 array elision elements, /** esnext : true, */ * @deprecated Use `esversion: 6` instead. * * 6](http://www.ecma-international.org/ecma-262/6.0/index.html) * * [Specification for ECMAScript * * More info: * * syntax. Note that not all browsers implement these features.adjgbZBA9 ? y q Y X P  } k d I { + r j S N M 7 ) EQL]W?>8Z hbJIC\{?9!  * This option can be used to specify a white list of global variables that /** predef : false, */ * JavaScript API or from an external configuration file. * This option cannot be specified in-line; it may only be used via the * * JSHint will consider variables declared in this way to be read-only. * * remove that name from the collection of predefined variables. * string values. Prefixing a variable name with a hyphen (-) character will * implicitly defined in the environment. Configure it with an array of * This option allows you to control which variables JSHint considers to be /** maxerr : false, */ * produce before giving up. Default is 50. * This options allows you to set the maximum amount of warnings JSHint will /** indent : false, */ * out [the JSCS project](https://github.com/jscs-dev/node-jscs). * you would like to enforce rules relating to code style, check * @deprecated JSHint is limiting its scope to issues of code correctness. If * * This option sets a specific tab width for your code. /** maxlen : false, */ * out [the JSCS project](https://github.com/jscs-dev/node-jscs). * you would like to enforce rules relating to code style, check * @deprecated JSHint is limiting its scope to issues of code correctness. If * * This option lets you set the maximum length of a line. /**exports.val = {// (we use this object to detect invalid options)// These are the JSHint options that can take any value}; } // should be tolerated regexdash : true // if unescaped first/last dash (-) inside brackets regexp : true, // if the . should not be allowed in regexp literals onecase : true, // if one case switch statements should be allowed obsolete: { // Obsolete options }, phantom : true */ * JSON, Canvas, and SVG. * native support for various web standards: DOM handling, CSS selector, * is a headless WebKit scriptable with a JavaScript API. It has fast and * of the PhantomJS runtime environment. [PhantomJS](http://phantomjs.org/) * This option defines globals available when your core is running inside /** typed : true, */ * arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays) * * [JavaScript typed * * More info: * * This option defines globals for typed array constructors. /** dojo : true, */ * Toolkit](http://dojotoolkit.org/). * This option defines globals exposed by the [Dojo /** devel : true, */ * legacy versions of Internet Explorer. * ship them in production because, for example, `console.log` breaks in * debugging: `console`, `alert`, etc. It is usually a good idea to not * This option defines globals that are usually used for logging poor-man's /** browserify : true, */ * tool](http://browserify.org/) to build a project. * This option defines globals available when using [the Browserify /** browser : true, */ * `console`. See option `devel` for more information. * **Note:** This option doesn't expose variables like `alert` or * * new developments in the browser world. * good old `document` and `navigator` to the HTML5 `FileReader` and other * This option defines globals exposed by modern browsers: all the way from /** nonstandard : true, */ * `escape` and `unescape`.ad' rmE@F c ] E D > U  V  w r O J /   r T ; "  ihbpVQA2- <*_V {[0*   /** shadow : false, */ * - true - allow variable shadowing * - false - same as inner * - "outer" - check for variables defined in outer scopes as well * - "inner" - check for variables defined in the same scope only * * variable that had been already declared somewhere in the outer scope. * This option suppresses warnings about variable shadowing i.e. declaring a /** maxcomplexity: false, */ * Wikipedia](http://en.wikipedia.org/wiki/Cyclomatic_complexity). * through a program's source code. Read more about [cyclomatic complexity on * Cyclomatic complexity measures the number of linearly independent paths * This option lets you control cyclomatic complexity throughout your code. /** maxparams : false, */ * } * // ... * function logout(request, isManual, whereAmI, onSuccess) { * // JSHint: Too many parameters per function (4). * * } * // ... * function login(request, onSuccess) { * * // jshint maxparams:3 * * function: * This option lets you set the max number of formal parameters allowed per /** maxdepth : false, */ * } * } * } * } * sleep(); * if (tired) { // JSHint: Blocks are nested too deeply (3). * * shuffle(); * while (day) { * if (meaning === 42) { * * var day = true; * function main(meaning) { * * // jshint maxdepth:2 * * This option lets you control how nested do you want your blocks to be: /** maxstatements: false, */ * } * return j; // JSHint: Too many statements per function. (5) * j = i + j; * * } * return i2 + j2; * * var j2 = 1; * var i2 = 1; * function inner() { * // don't get taken into account for the outer function. * // Function declarations count as one statement. Their bodies * * var j = 0; * var i = 0; * function main() { * * // jshint maxstatements:4 * * This option lets you set the max number of statements allowed per function: /** scope : false, quotmark : false, */ * out [the JSCS project](https://github.com/jscs-dev/node-jscs). * you would like to enforce rules relating to code style, check * @deprecated JSHint is limiting its scope to issues of code correctness. If * * quotes. * allow only single quotes and `"double"` if you want to allow only double * one particular style but want some consistency, `"single"` if you want to * your code. It accepts three values: `true` if you don't want to enforce * This option enforces the consistency of quotation marks used throughout /** globals : false, */ * Configuration](http://jshint.com/docs/#inline-configuration). * To configure `globals` within an individual file, see [Inline * * environments. * hand for enabling global variables defined in common JavaScript * See also the "environment" options: a set of options to be used as short * * read-only. * Setting it to `false` will trigger JSHint to consider that variable * Setting an entry to `true` enables reading and writing to that variable. * * project-specific global variables. * combined with the `undef` option in order to suppress warnings for * are not formally defined in the source code. This is most useful whenad$Qk D? n  8    c U P 1 , x D ? w ) M^"rPwoH b * This includes allowing reserved keywords as object properties. * specification](http://www.ecma-international.org/ecma-262/5.1/index.html). * - `5` - To enable syntax first defined in [the ECMAScript 5.1 * JavaScript environments * in older browsers—such as Internet Explorer 6/7/8/9—and other legacy * - `3` - If you need your program to be executable * must adhere. It can assume one of the following values: * This option is used to specify the ECMAScript version to which the code /** // certain chunks from code ignoreDelimiters: false, // array of start/end delimiters used to ignore // (this option does not bypass the lexer) // line - ignore warnings / errors for just a single line // end - stop ignoring lines, starting on the next line // start - start ignoring lines, including the current line ignore : false, // start/end ignoring lines of code, bypassing the lexer latedef : false, */ * by Ben Cherry. * Hoisting](http://www.adequatelygood.com/2010/2/JavaScript-Scoping-and-Hoisting) * read [JavaScript Scoping and * For more in-depth understanding of scoping and hoisting in JavaScript, * * ignored. * Setting this option to "nofunc" will allow function declarations to be * * variable only after they have been explicitly defined. * lead to some very nasty bugs and that's why it is safer to always use * are always moved—or hoisted— to the top of the function. This behavior can * JavaScript has function scope only and, in addition to that, all variables * This option prohibits the use of a variable before it was defined. /** unused : true, */ * all variables and parameters. * only check for variables, not function parameters, or `strict` to check * parameter will not produce warnings. This option can be set to `vars` to * When set to `true`, unused parameters that are followed by a used * * variables declared via the `global` directive. * In addition to that, this option will warn you about unused global * * // Line 4: 'c' was defined but never used. * // Line 3: 'b' was defined but never used. * * test(1, 2); * * } * return a + d; * * var c, d = 2; * function test(a, b) { * * // jshint unused:true * * `undef`. * useful for general code cleanup, especially when used in addition to * This option warns when you define and never use your variables. It is very /** strict : true, */ * page * could adversely effect other scripts running on the same * browsers directly because enabling strict mode globally * this is preferable for scripts intended to be loaded in web * - true - there must be a `"use strict";` directive at function level; * - false - disable warnings about strict mode * - "implied" - lint the code as if there is the `"use strict";` directive * - "global" - there must be a `"use strict";` directive at global level * * for the JavaScript engines to perform certain optimizations. * them to produce errors. It also fixes mistakes that made it difficult * eliminates some JavaScript pitfalls that didn't cause errors by changing * is a way to opt in to a restricted variant of JavaScript. Strict mode * [Strict mode](https://developer.mozilla.org/en/JavaScript/Strict_mode) * This option requires the code to run in ECMAScript 5's strict mode.adK[{l_X meMLD _ 1 * f "    l V B 5 . x * H %  ;0woWVNw( S<4u( g@ /** noempty : true, */ * project](https://github.com/jscs-dev/node-jscs). * check out [the JSCS * If you would like to enforce rules relating to code style, * @deprecated JSHint is limiting its scope to issues of code correctness. * * your code in any way. * There were no studies reporting that empty blocks in JavaScript break * originally warning for all empty blocks and we simply made it optional. * This option warns when you have an empty block in your code. JSLint was /** nocomma : true, */ * incorrect code. * comma operator can obscure the value of a statement and promote * This option prohibits the use of the comma operator. When misused, the /** noarg : true, */ * in strict mode. * JavaScript. In fact, ECMAScript 5 forbids the use of `arguments.callee` * optimizations impossible so they were deprecated in future versions of * `arguments.callee`. Both `.caller` and `.callee` make quite a few * This option prohibits the use of `arguments.caller` and /** newcap : true, */ * project](https://github.com/jscs-dev/node-jscs). * check out [the JSCS * If you would like to enforce rules relating to code style, * @deprecated JSHint is limiting its scope to issues of code correctness. * * of a new object. * `new` is used without it, `this` will point to the global object instead * important because when the function that was intended to be used with * function was supposed to be used with or without new. And this is * it will be a bit harder to figure out—by reading the code—if the * Not doing so won't break your code in any browsers or environments but * * mistakes when using `this`. * constructor functions from other types of functions to help spot * is just a convention that helps programmers to visually distinguish * Capitalizing functions that are intended to be used with `new` operator * This option requires you to capitalize names of constructor functions. /** leanswitch : true, */ * program behavior and may indicate an erroneous refactoring. * While clauses like these are techincally valid, they do not effect * * } * z(); * default: * case 1: * switch (x) { * * e.g. * This option prohibits unnecessary clauses within `switch` statements, /** immed : true, */ * project](https://github.com/jscs-dev/node-jscs). * check out [the JSCS * If you would like to enforce rules relating to code style, * @deprecated JSHint is limiting its scope to issues of code correctness. * * function, and not the function itself. * your code in understanding that the expression is the result of a * wrapping them in parentheses. Wrapping parentheses assists readers of * This option prohibits the use of immediate function invocations without /** forin : true, */ * by Angus Croll. * loops](http://javascriptweblog.wordpress.com/2011/01/04/exploring-javascript-for-in-loops/) * [Exploring JavaScript for-in * For more in-depth understanding of `for in` loops in JavaScript, read * * } * } * // We are sure that obj[key] belongs to the object and was not inherited. * if (obj.hasOwnProperty(key)) {