mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 23:53:49 +00:00
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:
@ -88,7 +88,11 @@ define(
|
||||
priority: -1000,
|
||||
|
||||
// Two-way bind key, ngModel, and parameters
|
||||
scope: { key: "=", ngModel: "=", parameters: "=" }
|
||||
scope: {
|
||||
key: "=",
|
||||
ngModel: "=",
|
||||
parameters: "="
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -74,8 +74,8 @@ define(
|
||||
// Filter candidates by object type
|
||||
for (i = 0; i < candidates.length; i += 1) {
|
||||
type = candidates[i].type;
|
||||
if (!type || !domainObject ||
|
||||
domainObject.getCapability('type').instanceOf(type)) {
|
||||
if (!type || !domainObject
|
||||
|| domainObject.getCapability('type').instanceOf(type)) {
|
||||
return candidates[i];
|
||||
}
|
||||
}
|
||||
@ -146,10 +146,10 @@ define(
|
||||
}
|
||||
|
||||
function unchanged(canRepresent, idPath, key) {
|
||||
return (canRepresent === couldRepresent) &&
|
||||
(key === lastKey) &&
|
||||
(idPath.length === lastIdPath.length) &&
|
||||
idPath.every(function (id, i) {
|
||||
return (canRepresent === couldRepresent)
|
||||
&& (key === lastKey)
|
||||
&& (idPath.length === lastIdPath.length)
|
||||
&& idPath.every(function (id, i) {
|
||||
return id === lastIdPath[i];
|
||||
});
|
||||
}
|
||||
@ -158,9 +158,11 @@ define(
|
||||
if (!domainObject) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!domainObject.hasCapability('context')) {
|
||||
return [domainObject.getId()];
|
||||
}
|
||||
|
||||
return domainObject.getCapability('context')
|
||||
.getPath().map(function (pathObject) {
|
||||
return pathObject.getId();
|
||||
@ -174,7 +176,7 @@ define(
|
||||
var domainObject = $scope.domainObject,
|
||||
representation = lookup($scope.key, domainObject),
|
||||
uses = ((representation || {}).uses || []),
|
||||
canRepresent = !!(representation && domainObject),
|
||||
canRepresent = Boolean(representation && domainObject),
|
||||
idPath = getIdPath(domainObject),
|
||||
key = $scope.key;
|
||||
|
||||
@ -300,7 +302,6 @@ define(
|
||||
* being represented
|
||||
*/
|
||||
|
||||
|
||||
return MCTRepresentation;
|
||||
}
|
||||
);
|
||||
|
@ -151,6 +151,7 @@ define(
|
||||
} else {
|
||||
removeElement();
|
||||
}
|
||||
|
||||
activeTemplateUrl = templateUrl;
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,6 @@ define(
|
||||
domainObject.getId()
|
||||
);
|
||||
|
||||
|
||||
} catch (err) {
|
||||
// Exceptions at this point indicate that the browser
|
||||
// do not fully support drag-and-drop (e.g. if
|
||||
@ -108,7 +107,6 @@ define(
|
||||
this.endDragCallback = endDrag;
|
||||
}
|
||||
|
||||
|
||||
DragGesture.prototype.destroy = function () {
|
||||
// Detach listener
|
||||
this.element.removeAttr('draggable');
|
||||
|
@ -83,6 +83,7 @@ define(
|
||||
|
||||
// Indicate that we will accept the drag
|
||||
event.preventDefault(); // Required in Chrome?
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -123,7 +124,6 @@ define(
|
||||
this.element.off('drop', this.dropCallback);
|
||||
};
|
||||
|
||||
|
||||
return DropGesture;
|
||||
}
|
||||
);
|
||||
|
@ -94,9 +94,9 @@ define(
|
||||
attachedGestures = gestureKeys.map(function (key) {
|
||||
return gestureMap[key];
|
||||
}).filter(function (Gesture) {
|
||||
return Gesture !== undefined && (Gesture.appliesTo ?
|
||||
Gesture.appliesTo(domainObject) :
|
||||
true);
|
||||
return Gesture !== undefined && (Gesture.appliesTo
|
||||
? Gesture.appliesTo(domainObject)
|
||||
: true);
|
||||
}).map(function (Gesture) {
|
||||
return new Gesture(element, domainObject);
|
||||
});
|
||||
|
Reference in New Issue
Block a user