New eslint rules auto fix (#3058)

* no-implicit-coercion and no-unneeded-ternary

* End every line with a semicolon

* Spacing and formatting

* Enabled semi-spacing

* Applies npm run lint:fix to code after master merge

* Fix merge issues

* Switched operator-linebreak to 'before'

Co-authored-by: Joshi <simplyrender@gmail.com>
This commit is contained in:
Andrew Henry
2020-07-31 12:11:03 -07:00
committed by GitHub
parent 573a63d359
commit a09da30768
739 changed files with 4660 additions and 2339 deletions

View File

@ -74,15 +74,17 @@ define(["zepto"], function ($) {
fileReader.onerror = function () {
return reject(event.target.result);
};
fileReader.readAsText(file);
});
};
FileInputService.prototype.newInput = function () {
FileInputService.prototype.newInput = function () {
var input = $(document.createElement('input'));
input.attr("type", "file");
input.css("display", "none");
$('body').append(input);
return input;
};

View File

@ -34,9 +34,9 @@ define(
function link(scope, element, attrs, control) {
function setText(fileName) {
scope.structure.text = fileName.length > 20 ?
fileName.substr(0, 20) + "..." :
fileName;
scope.structure.text = fileName.length > 20
? fileName.substr(0, 20) + "..."
: fileName;
}
function handleClick() {

View File

@ -59,6 +59,7 @@ define(
if ($scope.optionIndex === 0) {
$scope.optionIndex = $scope.filteredOptions.length;
}
$scope.optionIndex--;
fillInputWithIndexedOption();
}
@ -67,6 +68,7 @@ define(
if ($scope.optionIndex === $scope.filteredOptions.length - 1) {
$scope.optionIndex = -1;
}
$scope.optionIndex++;
fillInputWithIndexedOption();
}
@ -90,7 +92,7 @@ define(
incrementOptionIndex();
break;
case key.up:
$event.preventDefault(); // Prevents cursor jumping back and forth
$event.preventDefault(); // Prevents cursor jumping back and forth
decrementOptionIndex();
break;
case key.enter:

View File

@ -47,9 +47,9 @@ define(
function toGradient(triplet, value) {
return triplet.map(function (v) {
return Math.round(value > 0 ?
(v + (255 - v) * value) :
(v * (1 + value))
return Math.round(value > 0
? (v + (255 - v) * value)
: (v * (1 + value))
);
});
}
@ -66,6 +66,7 @@ define(
Math.round(28.3333 * group.length)
]));
}
GROUPS.push(group);
// Ten basic colors

View File

@ -96,8 +96,8 @@ define(
// Initialize forms values
updateDateTime(
($scope.ngModel && $scope.field) ?
$scope.ngModel[$scope.field] : undefined
($scope.ngModel && $scope.field)
? $scope.ngModel[$scope.field] : undefined
);
}

View File

@ -120,6 +120,7 @@ define(
ngModel.field = imageUrl;
console.warn('You cancelled the annotation!!!');
}
done(true);
}
}).show(imageUrl);