Permalink
Browse files

Added .jshintrc file and updated JSHint compatibility.

  • Loading branch information...
1 parent 2715b93 commit 9328488dc1e51ddec418ee07d8f725a5106c7131 @blueimp committed Dec 1, 2013
View
@@ -0,0 +1,81 @@
+{
+ "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
+ "camelcase" : true, // true: Identifiers must be in camelCase
+ "curly" : true, // true: Require {} for every new block or scope
+ "eqeqeq" : true, // true: Require triple equals (===) for comparison
+ "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
+ "immed" : true, // true: Require immediate invocations to be wrapped in parens
+ // e.g. `(function () { } ());`
+ "indent" : 4, // {int} Number of spaces to use for indentation
+ "latedef" : true, // true: Require variables/functions to be defined before being used
+ "newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()`
+ "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
+ "noempty" : true, // true: Prohibit use of empty blocks
+ "nonew" : true, // true: Prohibit use of constructors for side-effects (without assignment)
+ "plusplus" : false, // true: Prohibit use of `++` & `--`
+ "quotmark" : "single", // Quotation mark consistency:
+ // false : do nothing (default)
+ // true : ensure whatever is used is consistent
+ // "single" : require single quotes
+ // "double" : require double quotes
+ "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
+ "unused" : true, // true: Require all defined variables be used
+ "strict" : true, // true: Requires all functions run in ES5 Strict Mode
+ "trailing" : true, // true: Prohibit trailing whitespaces
+ "maxparams" : false, // {int} Max number of formal params allowed per function
+ "maxdepth" : false, // {int} Max depth of nested blocks (within functions)
+ "maxstatements" : false, // {int} Max number statements per function
+ "maxcomplexity" : false, // {int} Max cyclomatic complexity per function
+ "maxlen" : false, // {int} Max number of characters per line
+
+ // Relaxing
+ "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
+ "boss" : false, // true: Tolerate assignments where comparisons would be expected
+ "debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
+ "eqnull" : false, // true: Tolerate use of `== null`
+ "es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
+ "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
+ "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
+ // (ex: `for each`, multiple try/catch, function expression…)
+ "evil" : false, // true: Tolerate use of `eval` and `new Function()`
+ "expr" : false, // true: Tolerate `ExpressionStatement` as Programs
+ "funcscope" : false, // true: Tolerate defining variables inside control statements"
+ "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
+ "iterator" : false, // true: Tolerate using the `__iterator__` property
+ "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
+ "laxbreak" : false, // true: Tolerate possibly unsafe line breakings
+ "laxcomma" : false, // true: Tolerate comma-first style coding
+ "loopfunc" : false, // true: Tolerate functions being defined in loops
+ "multistr" : false, // true: Tolerate multi-line strings
+ "proto" : false, // true: Tolerate using the `__proto__` property
+ "scripturl" : false, // true: Tolerate script-targeted URLs
+ "smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment
+ "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
+ "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
+ "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
+ "validthis" : false, // true: Tolerate using this in a non-constructor function
+
+ // Environments
+ "browser" : false, // Web Browser (window, document, etc)
+ "couch" : false, // CouchDB
+ "devel" : false, // Development/debugging (alert, confirm, etc)
+ "dojo" : false, // Dojo Toolkit
+ "jquery" : false, // jQuery
+ "mootools" : false, // MooTools
+ "node" : false, // Node.js
+ "nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
+ "prototypejs" : false, // Prototype and Scriptaculous
+ "rhino" : false, // Rhino
+ "worker" : false, // Web Workers
+ "wsh" : false, // Windows Scripting Host
+ "yui" : false, // Yahoo User Interface
+
+ // Legacy
+ "nomen" : true, // true: Prohibit dangling `_` in variables
+ "onevar" : true, // true: Allow only one `var` statement per function
+ "passfail" : false, // true: Stop on first error
+ "white" : true, // true: Check against strict whitespace and indentation rules
+
+ // Custom Globals
+ "globals" : {} // additional predefined global variables
+}
View
@@ -16,10 +16,14 @@ module.exports = function (grunt) {
grunt.initConfig({
jshint: {
+ options: {
+ jshintrc: '.jshintrc'
+ },
all: [
'Gruntfile.js',
'js/cors/*.js',
- 'js/*.js'
+ 'js/*.js',
+ 'server/node/server.js'
]
}
});
View
@@ -9,8 +9,8 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint nomen: true, regexp: true */
-/*global window, angular */
+/* jshint nomen:false */
+/* global window, angular */
(function () {
'use strict';
@@ -9,8 +9,7 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint unparam: true, nomen: true */
-/*global define, window, document */
+/* global define, window, document */
(function (factory) {
'use strict';
@@ -12,8 +12,7 @@
* https://github.com/jaubourg/ajaxHooks/
*/
-/*jslint unparam: true */
-/*global define, window, XDomainRequest */
+/* global define, window, XDomainRequest */
(function (factory) {
'use strict';
@@ -9,8 +9,8 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint nomen: true, unparam: true */
-/*global define, angular */
+/* jshint nomen:false */
+/* global define, angular */
(function (factory) {
'use strict';
@@ -9,8 +9,8 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint nomen: true, unparam: true, regexp: true */
-/*global define, window, document */
+/* jshint nomen:false */
+/* global define, window, document */
(function (factory) {
'use strict';
@@ -9,8 +9,8 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint nomen: true, unparam: true, regexp: true */
-/*global define, window, document, DataView, Blob, Uint8Array */
+/* jshint nomen:false */
+/* global define, window, Blob */
(function (factory) {
'use strict';
@@ -9,8 +9,8 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint nomen: true, unparam: true */
-/*global define, window */
+/* jshint nomen:false */
+/* global define, window */
(function (factory) {
'use strict';
@@ -9,8 +9,8 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint nomen: true, unparam: true */
-/*global define, window */
+/* jshint nomen:false */
+/* global define, window */
(function (factory) {
'use strict';
@@ -1,5 +1,5 @@
/*
- * jQuery File Upload User Interface Plugin 9.4.0
+ * jQuery File Upload User Interface Plugin 9.4.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
@@ -9,8 +9,8 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint nomen: true, unparam: true, regexp: true */
-/*global define, window, URL, webkitURL, FileReader */
+/* jshint nomen:false */
+/* global define, window */
(function (factory) {
'use strict';
@@ -31,7 +31,7 @@
window.tmpl
);
}
-}(function ($, tmpl, loadImage) {
+}(function ($, tmpl) {
'use strict';
$.blueimp.fileupload.prototype._specialOptions.push(
@@ -9,8 +9,7 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint nomen: true, unparam: true, regexp: true */
-/*global define, window */
+/* global define, window */
(function (factory) {
'use strict';
@@ -9,8 +9,8 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint nomen: true, unparam: true, regexp: true */
-/*global define, window, document */
+/* jshint nomen:false */
+/* global define, window, document */
(function (factory) {
'use strict';
@@ -9,8 +9,8 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint nomen: true, unparam: true, regexp: true */
-/*global define, window, document, location, File, Blob, FormData */
+/* jshint nomen:false */
+/* global define, window, document, location, Blob, FormData */
(function (factory) {
'use strict';
@@ -9,8 +9,7 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint unparam: true, nomen: true */
-/*global define, window, document */
+/* global define, window, document */
(function (factory) {
'use strict';
View
@@ -9,8 +9,7 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint nomen: true, regexp: true */
-/*global $, window, blueimp */
+/* global $, window */
$(function () {
'use strict';
@@ -1,6 +1,6 @@
#!/usr/bin/env node
/*
- * jQuery File Upload Plugin Node.js Example 2.1.0
+ * jQuery File Upload Plugin Node.js Example 2.1.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2012, Sebastian Tschan
@@ -10,8 +10,8 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint nomen: true, regexp: true, unparam: true, stupid: true */
-/*global require, __dirname, unescape, console */
+/* jshint nomen:false */
+/* global require, __dirname, unescape, console */
(function (port) {
'use strict';
@@ -261,7 +261,7 @@
});
}).on('error', function (e) {
console.log(e);
- }).on('progress', function (bytesReceived, bytesExpected) {
+ }).on('progress', function (bytesReceived) {
if (bytesReceived > options.maxPostSize) {
handler.req.connection.destroy();
}

0 comments on commit 9328488

Please sign in to comment.