Add jshint

This commit is contained in:
Frederic Guillot
2016-11-25 18:51:22 -05:00
parent f73d369dd0
commit e64faae69a
13 changed files with 25 additions and 25 deletions

View File

@@ -24,6 +24,8 @@ before_script:
- if [[ $TRAVIS_PHP_VERSION != 7.x ]]; then phpenv config-rm xdebug.ini; fi - if [[ $TRAVIS_PHP_VERSION != 7.x ]]; then phpenv config-rm xdebug.ini; fi
- phpenv config-add tests/php.ini - phpenv config-add tests/php.ini
- composer install - composer install
- npm install
- ./node_modules/.bin/jshint assets/js/{core,components}
script: script:
- phpunit -c tests/units.$DB.xml - phpunit -c tests/units.$DB.xml

View File

@@ -9,6 +9,7 @@ static: clean
@ npm install @ npm install
@ ./node_modules/.bin/gulp bower @ ./node_modules/.bin/gulp bower
@ ./node_modules/.bin/gulp vendor js css @ ./node_modules/.bin/gulp vendor js css
@ ./node_modules/.bin/jshint assets/js/{core,components}
archive: archive:
@ echo "Build archive: version=${version}, destination=${dst}" @ echo "Build archive: version=${version}, destination=${dst}"

File diff suppressed because one or more lines are too long

View File

@@ -11,22 +11,21 @@ KB.component('chart-project-burndown', function (containerElement, options) {
for (var j = 0; j < metrics[i].length; j++) { for (var j = 0; j < metrics[i].length; j++) {
if (i == 0) { if (i === 0) {
columns.push([metrics[i][j]]); columns.push([metrics[i][j]]);
} } else {
else {
columns[j + 1].push(metrics[i][j]); columns[j + 1].push(metrics[i][j]);
if (j > 0) { if (j > 0) {
if (columns[0][i] == undefined) { if (columns[0][i] === undefined) {
columns[0].push(0); columns[0].push(0);
} }
columns[0][i] += metrics[i][j]; columns[0][i] += metrics[i][j];
} }
if (j == 0) { if (j === 0) {
categories.push(outputFormat(inputFormat.parse(metrics[i][j]))); categories.push(outputFormat(inputFormat.parse(metrics[i][j])));
} }
} }

View File

@@ -12,18 +12,17 @@ KB.component('chart-project-cumulative-flow', function (containerElement, option
for (var j = 0; j < metrics[i].length; j++) { for (var j = 0; j < metrics[i].length; j++) {
if (i == 0) { if (i === 0) {
columns.push([metrics[i][j]]); columns.push([metrics[i][j]]);
if (j > 0) { if (j > 0) {
groups.push(metrics[i][j]); groups.push(metrics[i][j]);
} }
} } else {
else {
columns[j].push(metrics[i][j]); columns[j].push(metrics[i][j]);
if (j == 0) { if (j === 0) {
categories.push(outputFormat(inputFormat.parse(metrics[i][j]))); categories.push(outputFormat(inputFormat.parse(metrics[i][j])));
} }
} }

View File

@@ -8,5 +8,5 @@ KB.component('external-task-view', function (containerElement, options) {
KB.dom(containerElement).html('<div id="external-task-view">' + data + '</div>'); KB.dom(containerElement).html('<div id="external-task-view">' + data + '</div>');
} }
}); });
} };
}); });

View File

@@ -1,5 +1,3 @@
'use strict';
var KB = { var KB = {
components: {}, components: {},
utils: {}, utils: {},

View File

@@ -135,7 +135,7 @@ Kanboard.App.prototype.datePicker = function() {
Kanboard.App.prototype.tagAutoComplete = function() { Kanboard.App.prototype.tagAutoComplete = function() {
$(".tag-autocomplete").select2({ $(".tag-autocomplete").select2({
tags: true tags: true
}) });
}; };
Kanboard.App.prototype.autoComplete = function() { Kanboard.App.prototype.autoComplete = function() {
@@ -144,7 +144,7 @@ Kanboard.App.prototype.autoComplete = function() {
var field = input.data("dst-field"); var field = input.data("dst-field");
var extraField = input.data("dst-extra-field"); var extraField = input.data("dst-extra-field");
if ($('#form-' + field).val() == '') { if ($('#form-' + field).val() === '') {
input.parent().find("button[type=submit]").attr('disabled','disabled'); input.parent().find("button[type=submit]").attr('disabled','disabled');
} }
@@ -189,7 +189,7 @@ Kanboard.App.prototype.isVisible = function() {
property = "webkitVisibilityState"; property = "webkitVisibilityState";
} }
if (property != "") { if (property !== "") {
return document[property] == "visible"; return document[property] == "visible";
} }

View File

@@ -45,7 +45,7 @@ Kanboard.BoardDragAndDrop.prototype.dragAndDrop = function() {
if (isMobile.any) { if (isMobile.any) {
$(".task-board-sort-handle").css("display", "inline"); $(".task-board-sort-handle").css("display", "inline");
params["handle"] = ".task-board-sort-handle"; params.handle = ".task-board-sort-handle";
} }
// Set dropzone height to the height of the table cell // Set dropzone height to the height of the table cell

View File

@@ -1,3 +1 @@
'use strict';
var Kanboard = {}; var Kanboard = {};

View File

@@ -44,7 +44,7 @@ Kanboard.Screenshot.prototype.initialize = function() {
// Destroy contentEditable element // Destroy contentEditable element
Kanboard.Screenshot.prototype.destroy = function() { Kanboard.Screenshot.prototype.destroy = function() {
if (this.pasteCatcher != null) { if (this.pasteCatcher !== null) {
document.body.removeChild(this.pasteCatcher); document.body.removeChild(this.pasteCatcher);
} }
else if (document.getElementById("screenshot-pastezone")) { else if (document.getElementById("screenshot-pastezone")) {

File diff suppressed because one or more lines are too long

View File

@@ -10,5 +10,8 @@
"gulp-strip-comments": "^2.4.3", "gulp-strip-comments": "^2.4.3",
"gulp-uglify": "^1.5.3", "gulp-uglify": "^1.5.3",
"vue": "1.0.26-csp" "vue": "1.0.26-csp"
},
"devDependencies": {
"jshint": "^2.9.4"
} }
} }