From 086faa072ddd3e16c28c2ceaceaa90f32a05f7f9 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 3 Oct 2015 21:12:32 +1300 Subject: Ignore or fix JSHint issues --- web/.jshintignore | 2 ++ web/.jshintrc | 51 ++++++++++++++++++++-------------------- web/app/view/DeviceController.js | 2 +- web/app/view/LoginController.js | 4 ++-- web/app/view/MapController.js | 1 - web/app/view/ReportController.js | 6 ++--- web/app/view/StateController.js | 2 +- 7 files changed, 35 insertions(+), 33 deletions(-) create mode 100644 web/.jshintignore (limited to 'web') diff --git a/web/.jshintignore b/web/.jshintignore new file mode 100644 index 000000000..fa3c21b68 --- /dev/null +++ b/web/.jshintignore @@ -0,0 +1,2 @@ +l10n/** +tests/** diff --git a/web/.jshintrc b/web/.jshintrc index 98af67d9d..2039bc982 100644 --- a/web/.jshintrc +++ b/web/.jshintrc @@ -34,30 +34,30 @@ "varstmt" : false, // true: Disallow any var statements. Only `let` and `const` are allowed. // 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` - "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`) - "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) - "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 - "noyield" : false, // true: Tolerate generator functions with no yield statement in them. - "notypeof" : false, // true: Tolerate invalid typeof operator values - "proto" : false, // true: Tolerate using the `__proto__` property - "scripturl" : false, // true: Tolerate script-targeted URLs - "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 + "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` + "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`) + "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) + "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 + "noyield" : false, // true: Tolerate generator functions with no yield statement in them. + "notypeof" : false, // true: Tolerate invalid typeof operator values + "proto" : false, // true: Tolerate using the `__proto__` property + "scripturl" : false, // true: Tolerate script-targeted URLs + "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" : true, // Web Browser (window, document, etc) @@ -69,6 +69,7 @@ "Ext" : false, "ol" : false, "styles" : false, - "strings" : false + "strings" : false, + "Traccar" : false } } diff --git a/web/app/view/DeviceController.js b/web/app/view/DeviceController.js index 748ebabe6..1d0ebc545 100644 --- a/web/app/view/DeviceController.js +++ b/web/app/view/DeviceController.js @@ -103,7 +103,7 @@ this.lookupReference('deviceRemoveButton').setDisabled(empty); this.lookupReference('deviceCommandButton').setDisabled(empty); if (!empty) { - this.fireEvent("selectDevice", selected.getLastSelected()); + this.fireEvent('selectDevice', selected.getLastSelected()); } }, diff --git a/web/app/view/LoginController.js b/web/app/view/LoginController.js index 011fddc25..05118b170 100644 --- a/web/app/view/LoginController.js +++ b/web/app/view/LoginController.js @@ -72,9 +72,9 @@ if (url.indexOf(paramName + '=') >= 0) { var prefix = url.substring(0, url.indexOf(paramName)); var suffix = url.substring(url.indexOf(paramName)); - suffix = suffix.substring(suffix.indexOf("=") + 1); + suffix = suffix.substring(suffix.indexOf('=') + 1); suffix = (suffix.indexOf('&') >= 0) ? suffix.substring(suffix.indexOf('&')) : ''; - url = prefix + paramName + "=" + paramValue + suffix; + url = prefix + paramName + '=' + paramValue + suffix; } else { if (url.indexOf('?') < 0) { url += '?' + paramName + '=' + paramValue; diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js index cca746a20..7ce61e794 100644 --- a/web/app/view/MapController.js +++ b/web/app/view/MapController.js @@ -166,7 +166,6 @@ }, reportClear: function () { - var index; var vectorSource = this.getView().vectorSource; if (this.reportRoute !== undefined) { diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js index 8653784ab..1b226fd55 100644 --- a/web/app/view/ReportController.js +++ b/web/app/view/ReportController.js @@ -58,19 +58,19 @@ }, scope: this, callback: function () { - this.fireEvent("reportShow"); + this.fireEvent('reportShow'); } }); }, onClearClick: function () { Ext.getStore('Positions').removeAll(); - this.fireEvent("reportClear"); + this.fireEvent('reportClear'); }, onSelectionChange: function (selected) { if (selected.getCount() > 0) { - this.fireEvent("selectReport", selected.getLastSelected()); + this.fireEvent('selectReport', selected.getLastSelected()); } }, diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js index 489662ee7..c0b3c1056 100644 --- a/web/app/view/StateController.js +++ b/web/app/view/StateController.js @@ -84,7 +84,7 @@ }, updatePosition: function (position) { - var attributes, value, unit, store, key; + var attributes, store, key; store = Ext.getStore('Attributes'); store.removeAll(); -- cgit v1.2.3