ESLint upgrade, implement additional rules (#3230)
* upgrade to ESLintv7, added overrides for rules violated * removed overrides for spec files * fixed no-prototype-builtins issues * added rules for default-case-last, default-param-last, grouped-accessor-pairs, no-constructor-return, and added override for one violation Co-authored-by: Andrew Henry <akhenry@gmail.com> Co-authored-by: Shefali Joshi <simplyrender@gmail.com>
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define([
|
||||
"./src/actions/ExportAsJSONAction",
|
||||
|
||||
@@ -86,7 +86,7 @@ define(['lodash'], function (_) {
|
||||
// Only export if object is creatable
|
||||
if (this.isCreatable(child)) {
|
||||
// Prevents infinite export of self-contained objs
|
||||
if (!this.tree.hasOwnProperty(this.getId(child))) {
|
||||
if (!Object.prototype.hasOwnProperty.call(this.tree, this.getId(child))) {
|
||||
// If object is a link to something absent from
|
||||
// tree, generate new id and treat as new object
|
||||
if (this.isExternal(child, parent)) {
|
||||
|
||||
@@ -144,7 +144,7 @@ define(
|
||||
setTimeout(resolve, 100);
|
||||
}).then(function () {
|
||||
expect(Object.keys(action.tree).length).toBe(1);
|
||||
expect(action.tree.hasOwnProperty("parentId"))
|
||||
expect(Object.prototype.hasOwnProperty.call(action.tree, "parentId"))
|
||||
.toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -184,9 +184,9 @@ define(
|
||||
setTimeout(resolve, 100);
|
||||
}).then(function () {
|
||||
expect(Object.keys(action.tree).length).toBe(2);
|
||||
expect(action.tree.hasOwnProperty("infiniteParentId"))
|
||||
expect(Object.prototype.hasOwnProperty.call(action.tree, "infiniteParentId"))
|
||||
.toBeTruthy();
|
||||
expect(action.tree.hasOwnProperty("infiniteChildId"))
|
||||
expect(Object.prototype.hasOwnProperty.call(action.tree, "infiniteChildId"))
|
||||
.toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -224,9 +224,9 @@ define(
|
||||
setTimeout(resolve, 100);
|
||||
}).then(function () {
|
||||
expect(Object.keys(action.tree).length).toBe(2);
|
||||
expect(action.tree.hasOwnProperty('parentId'))
|
||||
expect(Object.prototype.hasOwnProperty.call(action.tree, "parentId"))
|
||||
.toBeTruthy();
|
||||
expect(action.tree.hasOwnProperty('brandNewId'))
|
||||
expect(Object.prototype.hasOwnProperty.call(action.tree, "brandNewId"))
|
||||
.toBeTruthy();
|
||||
expect(action.tree.brandNewId.location).toBe('parentId');
|
||||
});
|
||||
@@ -239,8 +239,8 @@ define(
|
||||
setTimeout(resolve, 100);
|
||||
}).then(function () {
|
||||
expect(Object.keys(exportedTree).length).toBe(2);
|
||||
expect(exportedTree.hasOwnProperty('openmct')).toBeTruthy();
|
||||
expect(exportedTree.hasOwnProperty('rootId')).toBeTruthy();
|
||||
expect(Object.prototype.hasOwnProperty.call(exportedTree, "openmct")).toBeTruthy();
|
||||
expect(Object.prototype.hasOwnProperty.call(exportedTree, "rootId")).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user