From 4d560086dd28802bcc9a4b42ec96f11cfc5aa86d Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Mon, 10 Aug 2020 11:23:35 -0700 Subject: [PATCH] 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 Co-authored-by: Shefali Joshi --- .eslintrc.js | 23 +++++----- example/eventGenerator/bundle.js | 3 +- example/eventGenerator/src/EventTelemetry.js | 3 +- .../src/EventTelemetryProvider.js | 1 - example/export/ExportTelemetryAsCSVAction.js | 1 - example/export/bundle.js | 1 - example/forms/bundle.js | 1 - example/forms/src/ExampleFormController.js | 3 +- .../generator/GeneratorMetadataProvider.js | 2 +- example/generator/GeneratorProvider.js | 6 +-- example/generator/SinewaveLimitProvider.js | 1 - example/generator/generatorWorker.js | 4 +- example/generator/plugin.js | 1 - example/identity/bundle.js | 1 - .../identity/src/ExampleIdentityService.js | 1 - example/mobile/bundle.js | 1 - example/msl/bundle.js | 1 - example/msl/src/MSLDataDictionary.js | 1 - example/msl/src/RemsTelemetryModelProvider.js | 1 - example/msl/src/RemsTelemetryProvider.js | 1 - example/msl/src/RemsTelemetrySeries.js | 1 - example/msl/src/RemsTelemetryServerAdapter.js | 1 - example/notifications/bundle.js | 1 - .../src/DialogLaunchController.js | 1 - .../src/DialogLaunchIndicator.js | 1 - .../src/NotificationLaunchController.js | 1 - .../src/NotificationLaunchIndicator.js | 1 - example/persistence/bundle.js | 1 - .../src/BrowserPersistenceProvider.js | 1 - example/policy/bundle.js | 1 - example/policy/src/ExamplePolicy.js | 1 - example/profiling/bundle.js | 1 - example/profiling/src/DigestIndicator.js | 1 - example/profiling/src/WatchIndicator.js | 1 - example/scratchpad/bundle.js | 1 - .../src/ScratchPersistenceProvider.js | 2 - .../src/ExampleStyleGuideModelProvider.js | 1 - package.json | 4 +- .../TransactionCapabilityDecorator.js | 1 - .../TransactionalPersistenceCapability.js | 1 - .../edit/src/services/TransactionService.js | 1 - .../edit/test/actions/SaveActionSpec.js | 3 +- .../actions/SaveAndStopEditingActionSpec.js | 1 - .../edit/test/actions/SaveAsActionSpec.js | 3 +- .../TransactionalPersistenceCapabilitySpec.js | 3 +- .../controllers/EditActionControllerSpec.js | 1 - .../test/services/NestedTransactionSpec.js | 1 - .../test/services/TransactionManagerSpec.js | 1 - .../test/services/TransactionServiceSpec.js | 1 - .../edit/test/services/TransactionSpec.js | 1 - .../general/src/directives/MCTSelectable.js | 3 +- .../general/src/services/UrlService.js | 2 +- .../general/test/directives/MCTTreeSpec.js | 3 +- .../commonUI/general/test/ui/TreeViewSpec.js | 3 +- .../notification/src/NotificationService.js | 2 +- platform/core/src/models/ModelCacheService.js | 2 +- .../src/runs/TransactingMutationListener.js | 1 - platform/core/src/types/MergeModels.js | 4 +- .../entanglement/test/ControlledPromise.js | 4 +- .../entanglement/test/DomainObjectFactory.js | 9 ++-- .../test/services/MockCopyService.js | 1 - .../test/services/MockLinkService.js | 1 - .../test/services/MockMoveService.js | 1 - platform/framework/src/FrameworkLayer.js | 2 - platform/framework/src/Main.js | 4 +- platform/import-export/bundle.js | 1 - .../src/actions/ExportAsJSONAction.js | 2 +- .../test/actions/ExportAsJSONActionSpec.js | 14 +++--- .../src/services/BareBonesSearchWorker.js | 2 - .../src/services/GenericSearchProvider.js | 3 +- .../src/services/GenericSearchWorker.js | 2 - .../test/services/GenericSearchWorkerSpec.js | 2 - src/BundleRegistry.js | 2 +- src/adapter/policies/AdaptedViewPolicy.js | 2 +- src/adapter/runs/TypeDeprecationChecker.js | 5 +-- src/adapter/views/installLegacyViews.js | 2 +- src/api/notifications/NotificationAPI.js | 2 +- src/api/objects/object-utils.js | 4 +- src/api/telemetry/TelemetryAPI.js | 12 ++--- src/api/telemetry/TelemetryMetadataManager.js | 19 ++++---- src/api/telemetry/TelemetryValueFormatter.js | 4 +- src/api/types/TypeRegistry.js | 5 +-- src/plugins/condition/ConditionManager.js | 2 +- .../condition/components/Criterion.vue | 4 +- src/plugins/condition/utils/evaluator.js | 6 +-- .../components/DisplayLayout.vue | 4 +- src/plugins/notebook/snapshot-container.js | 1 + src/plugins/plot/plugin.js | 4 +- .../plot/src/chart/MCTChartAlarmPointSet.js | 3 +- .../plot/src/chart/MCTChartController.js | 3 +- .../plot/src/chart/MCTChartDirective.js | 3 +- .../plot/src/chart/MCTChartLineLinear.js | 3 +- .../plot/src/chart/MCTChartLineStepAfter.js | 3 +- .../plot/src/chart/MCTChartPointSet.js | 3 +- .../plot/src/chart/MCTChartSeriesElement.js | 3 +- .../plot/src/configuration/Collection.js | 3 +- src/plugins/plot/src/configuration/Model.js | 3 +- .../configuration/PlotConfigurationModel.js | 3 +- .../plot/src/configuration/PlotSeries.js | 3 +- src/plugins/plot/src/draw/DrawLoader.js | 3 +- .../plot/src/inspector/PlotEditRegion.js | 23 +++++++++- src/plugins/plot/src/lib/color.js | 3 +- src/plugins/plot/src/lib/extend.js | 2 +- .../plot/src/services/ExportImageService.js | 4 +- .../src/telemetry/StackedPlotController.js | 2 +- .../summaryWidget/src/ConditionManager.js | 7 ++- src/plugins/summaryWidget/src/eventHelpers.js | 24 +++++++++- .../src/MeanTelemetryProvider.js | 5 +-- .../telemetryMean/src/MockTelemetryApi.js | 4 +- src/plugins/telemetryTable/TelemetryTable.js | 2 +- .../telemetryTable/TelemetryTableColumn.js | 2 +- .../TelemetryTableViewProvider.js | 2 +- .../collections/FilteredTableRowCollection.js | 2 +- src/plugins/telemetryTable/plugin.js | 2 +- src/ui/registries/InspectorViewRegistry.js | 3 +- src/ui/registries/ToolbarRegistry.js | 3 +- src/ui/registries/ViewRegistry.js | 3 +- src/ui/router/ApplicationRouter.js | 45 ++++++++++++------- src/ui/toolbar/Toolbar.vue | 2 +- 119 files changed, 194 insertions(+), 225 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index bfcd58bdbc..ae67e781bf 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -120,6 +120,14 @@ module.exports = { "no-useless-computed-key": "error", // https://eslint.org/docs/rules/rest-spread-spacing "rest-spread-spacing": ["error"], + // https://eslint.org/docs/rules/default-case-last + "default-case-last": "error", + // https://eslint.org/docs/rules/default-param-last + "default-param-last": "error", + // https://eslint.org/docs/rules/grouped-accessor-pairs + "grouped-accessor-pairs": "error", + // https://eslint.org/docs/rules/no-constructor-return + "no-constructor-return": "error", // https://eslint.org/docs/rules/array-callback-return "array-callback-return": "error", // https://eslint.org/docs/rules/no-invalid-this @@ -224,26 +232,21 @@ module.exports = { } }], "vue/multiline-html-element-content-newline": "off", - "vue/singleline-html-element-content-newline": "off" + "vue/singleline-html-element-content-newline": "off", + }, "overrides": [ { - "files": ["*Spec.js"], + "files": LEGACY_FILES, "rules": { "no-unused-vars": [ "warn", { "vars": "all", "args": "none", - "varsIgnorePattern": "controller", - + "varsIgnorePattern": "controller" } - ] - } - }, { - "files": LEGACY_FILES, - "rules": { - // https://eslint.org/docs/rules/no-nested-ternary + ], "no-nested-ternary": "off", "no-var": "off" } diff --git a/example/eventGenerator/bundle.js b/example/eventGenerator/bundle.js index e11b1f7718..2701956aa1 100644 --- a/example/eventGenerator/bundle.js +++ b/example/eventGenerator/bundle.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2017, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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/EventTelemetryProvider" diff --git a/example/eventGenerator/src/EventTelemetry.js b/example/eventGenerator/src/EventTelemetry.js index f668c6c0e0..60ee3669aa 100644 --- a/example/eventGenerator/src/EventTelemetry.js +++ b/example/eventGenerator/src/EventTelemetry.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2017, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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 */ /** * Module defining EventTelemetry. diff --git a/example/eventGenerator/src/EventTelemetryProvider.js b/example/eventGenerator/src/EventTelemetryProvider.js index 424d35b1e1..a3267fd1c2 100644 --- a/example/eventGenerator/src/EventTelemetryProvider.js +++ b/example/eventGenerator/src/EventTelemetryProvider.js @@ -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,Promise*/ /** * Module defining EventTelemetryProvider. Created by chacskaylo on 06/18/2015. diff --git a/example/export/ExportTelemetryAsCSVAction.js b/example/export/ExportTelemetryAsCSVAction.js index b47f2a9337..bb3a9f259d 100644 --- a/example/export/ExportTelemetryAsCSVAction.js +++ b/example/export/ExportTelemetryAsCSVAction.js @@ -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([], function () { 'use strict'; diff --git a/example/export/bundle.js b/example/export/bundle.js index 7f9e46b9ef..615020437c 100644 --- a/example/export/bundle.js +++ b/example/export/bundle.js @@ -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([ './ExportTelemetryAsCSVAction' diff --git a/example/forms/bundle.js b/example/forms/bundle.js index c54568b55b..61533f81cb 100644 --- a/example/forms/bundle.js +++ b/example/forms/bundle.js @@ -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/ExampleFormController" diff --git a/example/forms/src/ExampleFormController.js b/example/forms/src/ExampleFormController.js index 655b656280..5a3892e033 100644 --- a/example/forms/src/ExampleFormController.js +++ b/example/forms/src/ExampleFormController.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2017, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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,window*/ define( [], diff --git a/example/generator/GeneratorMetadataProvider.js b/example/generator/GeneratorMetadataProvider.js index 5aba6e7c0d..179019b0d9 100644 --- a/example/generator/GeneratorMetadataProvider.js +++ b/example/generator/GeneratorMetadataProvider.js @@ -117,7 +117,7 @@ define([ } GeneratorMetadataProvider.prototype.supportsMetadata = function (domainObject) { - return METADATA_BY_TYPE.hasOwnProperty(domainObject.type); + return Object.prototype.hasOwnProperty.call(METADATA_BY_TYPE, domainObject.type); }; GeneratorMetadataProvider.prototype.getMetadata = function (domainObject) { diff --git a/example/generator/GeneratorProvider.js b/example/generator/GeneratorProvider.js index eee51cd822..936862de5a 100644 --- a/example/generator/GeneratorProvider.js +++ b/example/generator/GeneratorProvider.js @@ -62,15 +62,15 @@ define([ var workerRequest = {}; props.forEach(function (prop) { - if (domainObject.telemetry && domainObject.telemetry.hasOwnProperty(prop)) { + if (domainObject.telemetry && Object.prototype.hasOwnProperty.call(domainObject.telemetry, prop)) { workerRequest[prop] = domainObject.telemetry[prop]; } - if (request && request.hasOwnProperty(prop)) { + if (request && Object.prototype.hasOwnProperty.call(request, prop)) { workerRequest[prop] = request[prop]; } - if (!workerRequest.hasOwnProperty(prop)) { + if (!Object.prototype.hasOwnProperty.call(workerRequest, prop)) { workerRequest[prop] = REQUEST_DEFAULTS[prop]; } diff --git a/example/generator/SinewaveLimitProvider.js b/example/generator/SinewaveLimitProvider.js index 733cd816d4..147b384b34 100644 --- a/example/generator/SinewaveLimitProvider.js +++ b/example/generator/SinewaveLimitProvider.js @@ -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([ diff --git a/example/generator/generatorWorker.js b/example/generator/generatorWorker.js index 75936714e5..f4ba3c3792 100644 --- a/example/generator/generatorWorker.js +++ b/example/generator/generatorWorker.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2017, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -20,8 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global self*/ - (function () { var FIFTEEN_MINUTES = 15 * 60 * 1000; diff --git a/example/generator/plugin.js b/example/generator/plugin.js index 3813f0684c..6b13399188 100644 --- a/example/generator/plugin.js +++ b/example/generator/plugin.js @@ -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([ "./GeneratorProvider", diff --git a/example/identity/bundle.js b/example/identity/bundle.js index fe24ab16e6..2a54a79159 100644 --- a/example/identity/bundle.js +++ b/example/identity/bundle.js @@ -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/ExampleIdentityService" diff --git a/example/identity/src/ExampleIdentityService.js b/example/identity/src/ExampleIdentityService.js index 4ce5a13d03..391317c4d1 100644 --- a/example/identity/src/ExampleIdentityService.js +++ b/example/identity/src/ExampleIdentityService.js @@ -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( function () { diff --git a/example/mobile/bundle.js b/example/mobile/bundle.js index abb378a68d..950c561b37 100644 --- a/example/mobile/bundle.js +++ b/example/mobile/bundle.js @@ -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([], function () { "use strict"; diff --git a/example/msl/bundle.js b/example/msl/bundle.js index d7902d09fa..b2a5fde148 100644 --- a/example/msl/bundle.js +++ b/example/msl/bundle.js @@ -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/RemsTelemetryServerAdapter", diff --git a/example/msl/src/MSLDataDictionary.js b/example/msl/src/MSLDataDictionary.js index 4cdb9b1450..e3f045c70b 100644 --- a/example/msl/src/MSLDataDictionary.js +++ b/example/msl/src/MSLDataDictionary.js @@ -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( [], diff --git a/example/msl/src/RemsTelemetryModelProvider.js b/example/msl/src/RemsTelemetryModelProvider.js index a64e555bad..8b977f4eeb 100644 --- a/example/msl/src/RemsTelemetryModelProvider.js +++ b/example/msl/src/RemsTelemetryModelProvider.js @@ -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( function () { diff --git a/example/msl/src/RemsTelemetryProvider.js b/example/msl/src/RemsTelemetryProvider.js index 9076ceaa70..56e1480fd1 100644 --- a/example/msl/src/RemsTelemetryProvider.js +++ b/example/msl/src/RemsTelemetryProvider.js @@ -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 ( ['./RemsTelemetrySeries'], function (RemsTelemetrySeries) { diff --git a/example/msl/src/RemsTelemetrySeries.js b/example/msl/src/RemsTelemetrySeries.js index d0dbf30c62..02582bf198 100644 --- a/example/msl/src/RemsTelemetrySeries.js +++ b/example/msl/src/RemsTelemetrySeries.js @@ -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( function () { "use strict"; diff --git a/example/msl/src/RemsTelemetryServerAdapter.js b/example/msl/src/RemsTelemetryServerAdapter.js index 9ff5fb08ef..5573f6cdd4 100644 --- a/example/msl/src/RemsTelemetryServerAdapter.js +++ b/example/msl/src/RemsTelemetryServerAdapter.js @@ -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*/ /*jslint es5: true */ define( diff --git a/example/notifications/bundle.js b/example/notifications/bundle.js index ca8df25686..4ca5b3fdf5 100644 --- a/example/notifications/bundle.js +++ b/example/notifications/bundle.js @@ -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/DialogLaunchController", diff --git a/example/notifications/src/DialogLaunchController.js b/example/notifications/src/DialogLaunchController.js index b705ed01ec..c82175c4c5 100644 --- a/example/notifications/src/DialogLaunchController.js +++ b/example/notifications/src/DialogLaunchController.js @@ -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( [], diff --git a/example/notifications/src/DialogLaunchIndicator.js b/example/notifications/src/DialogLaunchIndicator.js index 1549a48f19..cbe5e6987b 100644 --- a/example/notifications/src/DialogLaunchIndicator.js +++ b/example/notifications/src/DialogLaunchIndicator.js @@ -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,window*/ define( [], diff --git a/example/notifications/src/NotificationLaunchController.js b/example/notifications/src/NotificationLaunchController.js index b8d9b77f14..f82b5f2ee2 100644 --- a/example/notifications/src/NotificationLaunchController.js +++ b/example/notifications/src/NotificationLaunchController.js @@ -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( [], diff --git a/example/notifications/src/NotificationLaunchIndicator.js b/example/notifications/src/NotificationLaunchIndicator.js index 5a530cdf26..2154a43270 100644 --- a/example/notifications/src/NotificationLaunchIndicator.js +++ b/example/notifications/src/NotificationLaunchIndicator.js @@ -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,window*/ define( [], diff --git a/example/persistence/bundle.js b/example/persistence/bundle.js index 726fde3f7e..aa43500719 100644 --- a/example/persistence/bundle.js +++ b/example/persistence/bundle.js @@ -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/BrowserPersistenceProvider" diff --git a/example/persistence/src/BrowserPersistenceProvider.js b/example/persistence/src/BrowserPersistenceProvider.js index 6466228d4f..ddf4bc1534 100644 --- a/example/persistence/src/BrowserPersistenceProvider.js +++ b/example/persistence/src/BrowserPersistenceProvider.js @@ -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*/ /** * Stubbed implementation of a persistence provider, diff --git a/example/policy/bundle.js b/example/policy/bundle.js index 003a8cd945..8f8dc05bcb 100644 --- a/example/policy/bundle.js +++ b/example/policy/bundle.js @@ -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/ExamplePolicy" diff --git a/example/policy/src/ExamplePolicy.js b/example/policy/src/ExamplePolicy.js index 1987fa772d..4a81917155 100644 --- a/example/policy/src/ExamplePolicy.js +++ b/example/policy/src/ExamplePolicy.js @@ -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( [], diff --git a/example/profiling/bundle.js b/example/profiling/bundle.js index d1eafdfba9..328e1c265e 100644 --- a/example/profiling/bundle.js +++ b/example/profiling/bundle.js @@ -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/WatchIndicator", diff --git a/example/profiling/src/DigestIndicator.js b/example/profiling/src/DigestIndicator.js index 51f6d0f48d..a659816ab1 100644 --- a/example/profiling/src/DigestIndicator.js +++ b/example/profiling/src/DigestIndicator.js @@ -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( [], diff --git a/example/profiling/src/WatchIndicator.js b/example/profiling/src/WatchIndicator.js index 6a370b8511..69ab014202 100644 --- a/example/profiling/src/WatchIndicator.js +++ b/example/profiling/src/WatchIndicator.js @@ -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( [], diff --git a/example/scratchpad/bundle.js b/example/scratchpad/bundle.js index 327d9720ce..0ff4ed96ac 100644 --- a/example/scratchpad/bundle.js +++ b/example/scratchpad/bundle.js @@ -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/ScratchPersistenceProvider" diff --git a/example/scratchpad/src/ScratchPersistenceProvider.js b/example/scratchpad/src/ScratchPersistenceProvider.js index 4384962d48..a3bc811ece 100644 --- a/example/scratchpad/src/ScratchPersistenceProvider.js +++ b/example/scratchpad/src/ScratchPersistenceProvider.js @@ -20,8 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global define,window*/ - define( [], function () { diff --git a/example/styleguide/src/ExampleStyleGuideModelProvider.js b/example/styleguide/src/ExampleStyleGuideModelProvider.js index 682ffdd85b..80f170a9e9 100644 --- a/example/styleguide/src/ExampleStyleGuideModelProvider.js +++ b/example/styleguide/src/ExampleStyleGuideModelProvider.js @@ -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( [], diff --git a/package.json b/package.json index 46e9991799..44608b8bd2 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "devDependencies": { "angular": ">=1.8.0", "angular-route": "1.4.14", - "babel-eslint": "8.2.6", + "babel-eslint": "10.0.3", "comma-separated-values": "^3.6.4", "concurrently": "^3.6.1", "copy-webpack-plugin": "^4.5.2", @@ -22,7 +22,7 @@ "d3-selection": "1.3.x", "d3-time": "1.0.x", "d3-time-format": "2.1.x", - "eslint": "5.2.0", + "eslint": "7.0.0", "eslint-plugin-vue": "^6.0.0", "eslint-plugin-you-dont-need-lodash-underscore": "^6.10.0", "eventemitter3": "^1.2.0", diff --git a/platform/commonUI/edit/src/capabilities/TransactionCapabilityDecorator.js b/platform/commonUI/edit/src/capabilities/TransactionCapabilityDecorator.js index d3d03ddf07..06c2db51bc 100644 --- a/platform/commonUI/edit/src/capabilities/TransactionCapabilityDecorator.js +++ b/platform/commonUI/edit/src/capabilities/TransactionCapabilityDecorator.js @@ -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( ['./TransactionalPersistenceCapability'], diff --git a/platform/commonUI/edit/src/capabilities/TransactionalPersistenceCapability.js b/platform/commonUI/edit/src/capabilities/TransactionalPersistenceCapability.js index 4d03a7ff63..e05e8366f9 100644 --- a/platform/commonUI/edit/src/capabilities/TransactionalPersistenceCapability.js +++ b/platform/commonUI/edit/src/capabilities/TransactionalPersistenceCapability.js @@ -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( [], diff --git a/platform/commonUI/edit/src/services/TransactionService.js b/platform/commonUI/edit/src/services/TransactionService.js index b34a623f6d..c7badbd1ee 100644 --- a/platform/commonUI/edit/src/services/TransactionService.js +++ b/platform/commonUI/edit/src/services/TransactionService.js @@ -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( ['./Transaction', './NestedTransaction'], function (Transaction, NestedTransaction) { diff --git a/platform/commonUI/edit/test/actions/SaveActionSpec.js b/platform/commonUI/edit/test/actions/SaveActionSpec.js index f052cc9ea1..b172bcd79f 100644 --- a/platform/commonUI/edit/test/actions/SaveActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveActionSpec.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global describe,it,expect,beforeEach,jasmine*/ define( ["../../src/actions/SaveAction"], diff --git a/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js b/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js index e278729b35..4cc87233ef 100644 --- a/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global describe,it,expect,beforeEach,jasmine*/ define( ["../../src/actions/SaveAndStopEditingAction"], diff --git a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js index 411ea484eb..51a0efaea5 100644 --- a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global describe,it,expect,beforeEach,jasmine,spyOn*/ define( ["../../src/actions/SaveAsAction"], diff --git a/platform/commonUI/edit/test/capabilities/TransactionalPersistenceCapabilitySpec.js b/platform/commonUI/edit/test/capabilities/TransactionalPersistenceCapabilitySpec.js index 250a49cc15..8b4807793e 100644 --- a/platform/commonUI/edit/test/capabilities/TransactionalPersistenceCapabilitySpec.js +++ b/platform/commonUI/edit/test/capabilities/TransactionalPersistenceCapabilitySpec.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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,describe,it,expect,beforeEach,jasmine*/ define( [ diff --git a/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js b/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js index 09ae21468f..e8384bd6bb 100644 --- a/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js +++ b/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global describe,it,expect,beforeEach,jasmine*/ define( ["../../src/controllers/EditActionController"], diff --git a/platform/commonUI/edit/test/services/NestedTransactionSpec.js b/platform/commonUI/edit/test/services/NestedTransactionSpec.js index 019b56742a..cfc7309406 100644 --- a/platform/commonUI/edit/test/services/NestedTransactionSpec.js +++ b/platform/commonUI/edit/test/services/NestedTransactionSpec.js @@ -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,describe,it,expect,beforeEach,jasmine*/ define(["../../src/services/NestedTransaction"], function (NestedTransaction) { var TRANSACTION_METHODS = ['add', 'commit', 'cancel', 'size']; diff --git a/platform/commonUI/edit/test/services/TransactionManagerSpec.js b/platform/commonUI/edit/test/services/TransactionManagerSpec.js index 47c1592ff3..579e6c7cf6 100644 --- a/platform/commonUI/edit/test/services/TransactionManagerSpec.js +++ b/platform/commonUI/edit/test/services/TransactionManagerSpec.js @@ -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,describe,it,expect,beforeEach,jasmine*/ define( ["../../src/services/TransactionManager"], diff --git a/platform/commonUI/edit/test/services/TransactionServiceSpec.js b/platform/commonUI/edit/test/services/TransactionServiceSpec.js index d1be5033a6..aaf774dd91 100644 --- a/platform/commonUI/edit/test/services/TransactionServiceSpec.js +++ b/platform/commonUI/edit/test/services/TransactionServiceSpec.js @@ -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,describe,it,expect,beforeEach,jasmine*/ define( ["../../src/services/TransactionService"], diff --git a/platform/commonUI/edit/test/services/TransactionSpec.js b/platform/commonUI/edit/test/services/TransactionSpec.js index d51eb0bacd..8cf0f7f3c8 100644 --- a/platform/commonUI/edit/test/services/TransactionSpec.js +++ b/platform/commonUI/edit/test/services/TransactionSpec.js @@ -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,describe,it,expect,beforeEach,jasmine*/ define( ["../../src/services/Transaction"], diff --git a/platform/commonUI/general/src/directives/MCTSelectable.js b/platform/commonUI/general/src/directives/MCTSelectable.js index 7ad4b79dbb..a14401076b 100644 --- a/platform/commonUI/general/src/directives/MCTSelectable.js +++ b/platform/commonUI/general/src/directives/MCTSelectable.js @@ -58,7 +58,8 @@ define( var removeSelectable = openmct.selection.selectable( element[0], scope.$eval(attrs.mctSelectable), - attrs.hasOwnProperty('mctInitSelect') && scope.$eval(attrs.mctInitSelect) !== false + Object.prototype.hasOwnProperty.call(attrs, 'mctInitSelect') + && scope.$eval(attrs.mctInitSelect) !== false ); scope.$on("$destroy", function () { diff --git a/platform/commonUI/general/src/services/UrlService.js b/platform/commonUI/general/src/services/UrlService.js index 4fabd4d0fe..7b91b0b767 100644 --- a/platform/commonUI/general/src/services/UrlService.js +++ b/platform/commonUI/general/src/services/UrlService.js @@ -76,7 +76,7 @@ define( var search = this.$location.search(), arr = []; for (var key in search) { - if (search.hasOwnProperty(key)) { + if (Object.prototype.hasOwnProperty.call(search, key)) { arr.push(key + '=' + search[key]); } } diff --git a/platform/commonUI/general/test/directives/MCTTreeSpec.js b/platform/commonUI/general/test/directives/MCTTreeSpec.js index a55eb0e802..9a1ad3e8ed 100644 --- a/platform/commonUI/general/test/directives/MCTTreeSpec.js +++ b/platform/commonUI/general/test/directives/MCTTreeSpec.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/* global console*/ define([ '../../src/directives/MCTTree', diff --git a/platform/commonUI/general/test/ui/TreeViewSpec.js b/platform/commonUI/general/test/ui/TreeViewSpec.js index 79310316b8..9f4991989b 100644 --- a/platform/commonUI/general/test/ui/TreeViewSpec.js +++ b/platform/commonUI/general/test/ui/TreeViewSpec.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global describe,beforeEach,jasmine,it,expect*/ define([ '../../src/ui/TreeView', diff --git a/platform/commonUI/notification/src/NotificationService.js b/platform/commonUI/notification/src/NotificationService.js index f914a15565..595a94f60b 100644 --- a/platform/commonUI/notification/src/NotificationService.js +++ b/platform/commonUI/notification/src/NotificationService.js @@ -27,7 +27,7 @@ export default class NotificationService { if (typeof message === 'string') { return this.openmct.notifications.info(message); } else { - if (message.hasOwnProperty('progress')) { + if (Object.prototype.hasOwnProperty.call(message, 'progress')) { return this.openmct.notifications.progress(message.title, message.progress, message.progressText); } else { return this.openmct.notifications.info(message.title); diff --git a/platform/core/src/models/ModelCacheService.js b/platform/core/src/models/ModelCacheService.js index 2a781df7e4..aa25837a8b 100644 --- a/platform/core/src/models/ModelCacheService.js +++ b/platform/core/src/models/ModelCacheService.js @@ -56,7 +56,7 @@ define([], function () { * @returns {boolean} true if present; false if not */ ModelCacheService.prototype.has = function (id) { - return this.cache.hasOwnProperty(id); + return Object.prototype.hasOwnProperty.call(this.cache, id); }; /** diff --git a/platform/core/src/runs/TransactingMutationListener.js b/platform/core/src/runs/TransactingMutationListener.js index 3f361bed86..9571c913ab 100644 --- a/platform/core/src/runs/TransactingMutationListener.js +++ b/platform/core/src/runs/TransactingMutationListener.js @@ -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([], function () { diff --git a/platform/core/src/types/MergeModels.js b/platform/core/src/types/MergeModels.js index 9bcb224bad..448182de98 100644 --- a/platform/core/src/types/MergeModels.js +++ b/platform/core/src/types/MergeModels.js @@ -75,13 +75,13 @@ define( function mergeObjects(a, b) { var result = {}; Object.keys(a).forEach(function (k) { - result[k] = b.hasOwnProperty(k) + result[k] = Object.prototype.hasOwnProperty.call(b, k) ? mergeModels(a[k], b[k], (merger || {})[k]) : a[k]; }); Object.keys(b).forEach(function (k) { // Copy any properties not already merged - if (!a.hasOwnProperty(k)) { + if (!Object.prototype.hasOwnProperty.call(a, k)) { result[k] = b[k]; } }); diff --git a/platform/entanglement/test/ControlledPromise.js b/platform/entanglement/test/ControlledPromise.js index a793e6cadb..492c0bf9bf 100644 --- a/platform/entanglement/test/ControlledPromise.js +++ b/platform/entanglement/test/ControlledPromise.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global spyOn*/ + define( function () { diff --git a/platform/entanglement/test/DomainObjectFactory.js b/platform/entanglement/test/DomainObjectFactory.js index 25cf7a7041..441367d7e1 100644 --- a/platform/entanglement/test/DomainObjectFactory.js +++ b/platform/entanglement/test/DomainObjectFactory.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -20,7 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global jasmine*/ define( function () { @@ -110,7 +109,7 @@ define( * @returns {*} capability object */ domainObject.getCapability.and.callFake(function (capability) { - if (config.capabilities.hasOwnProperty(capability)) { + if (Object.prototype.hasOwnProperty.call(config.capabilities, capability)) { return config.capabilities[capability]; } }); @@ -124,7 +123,7 @@ define( * @returns {boolean} */ domainObject.hasCapability.and.callFake(function (capability) { - return config.capabilities.hasOwnProperty(capability); + return Object.prototype.hasOwnProperty.call(config.capabilities, capability); }); /** @@ -137,7 +136,7 @@ define( * @returns {*} result whatever was returned by `invoke`. */ domainObject.useCapability.and.callFake(function (capability) { - if (config.capabilities.hasOwnProperty(capability)) { + if (Object.prototype.hasOwnProperty.call(config.capabilities, capability)) { if (!config.capabilities[capability].invoke) { throw new Error( capability + ' missing invoke function.' diff --git a/platform/entanglement/test/services/MockCopyService.js b/platform/entanglement/test/services/MockCopyService.js index efbc0abdbb..ad6e1930c9 100644 --- a/platform/entanglement/test/services/MockCopyService.js +++ b/platform/entanglement/test/services/MockCopyService.js @@ -20,7 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global jasmine*/ define( function () { diff --git a/platform/entanglement/test/services/MockLinkService.js b/platform/entanglement/test/services/MockLinkService.js index d2e1dc1631..24e6293b19 100644 --- a/platform/entanglement/test/services/MockLinkService.js +++ b/platform/entanglement/test/services/MockLinkService.js @@ -20,7 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global jasmine*/ define( [ '../ControlledPromise' diff --git a/platform/entanglement/test/services/MockMoveService.js b/platform/entanglement/test/services/MockMoveService.js index ecc836c193..7d6c32bb64 100644 --- a/platform/entanglement/test/services/MockMoveService.js +++ b/platform/entanglement/test/services/MockMoveService.js @@ -20,7 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global jasmine*/ define( function () { diff --git a/platform/framework/src/FrameworkLayer.js b/platform/framework/src/FrameworkLayer.js index 261c005486..a60792c0de 100644 --- a/platform/framework/src/FrameworkLayer.js +++ b/platform/framework/src/FrameworkLayer.js @@ -20,8 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global window*/ - define([ './Constants', './FrameworkInitializer', diff --git a/platform/framework/src/Main.js b/platform/framework/src/Main.js index 29e64a4cd8..cc34c1425e 100644 --- a/platform/framework/src/Main.js +++ b/platform/framework/src/Main.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -20,8 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global window*/ - /** * Implements the framework layer, which handles the loading of bundles * and the wiring-together of the extensions they expose. diff --git a/platform/import-export/bundle.js b/platform/import-export/bundle.js index fda08e9865..4c938de471 100644 --- a/platform/import-export/bundle.js +++ b/platform/import-export/bundle.js @@ -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", diff --git a/platform/import-export/src/actions/ExportAsJSONAction.js b/platform/import-export/src/actions/ExportAsJSONAction.js index 854c5e44dd..c274892455 100644 --- a/platform/import-export/src/actions/ExportAsJSONAction.js +++ b/platform/import-export/src/actions/ExportAsJSONAction.js @@ -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)) { diff --git a/platform/import-export/test/actions/ExportAsJSONActionSpec.js b/platform/import-export/test/actions/ExportAsJSONActionSpec.js index 908cbe2cd0..0c1db43082 100644 --- a/platform/import-export/test/actions/ExportAsJSONActionSpec.js +++ b/platform/import-export/test/actions/ExportAsJSONActionSpec.js @@ -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(); }); }); diff --git a/platform/search/src/services/BareBonesSearchWorker.js b/platform/search/src/services/BareBonesSearchWorker.js index 6629670d08..ae279f4dbc 100644 --- a/platform/search/src/services/BareBonesSearchWorker.js +++ b/platform/search/src/services/BareBonesSearchWorker.js @@ -20,8 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global self*/ - /** * Module defining BareBonesSearchWorker. Created by deeptailor on 10/03/2019. */ diff --git a/platform/search/src/services/GenericSearchProvider.js b/platform/search/src/services/GenericSearchProvider.js index c6042196ea..f389d1bd50 100644 --- a/platform/search/src/services/GenericSearchProvider.js +++ b/platform/search/src/services/GenericSearchProvider.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global setTimeout*/ /** * Module defining GenericSearchProvider. Created by shale on 07/16/2015. diff --git a/platform/search/src/services/GenericSearchWorker.js b/platform/search/src/services/GenericSearchWorker.js index 6979db4138..191788e04b 100644 --- a/platform/search/src/services/GenericSearchWorker.js +++ b/platform/search/src/services/GenericSearchWorker.js @@ -20,8 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global self*/ - /** * Module defining GenericSearchWorker. Created by shale on 07/21/2015. */ diff --git a/platform/search/test/services/GenericSearchWorkerSpec.js b/platform/search/test/services/GenericSearchWorkerSpec.js index 1ad6d48cd7..a41b10d0ae 100644 --- a/platform/search/test/services/GenericSearchWorkerSpec.js +++ b/platform/search/test/services/GenericSearchWorkerSpec.js @@ -20,8 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global require*/ - /** * SearchSpec. Created by shale on 07/31/2015. */ diff --git a/src/BundleRegistry.js b/src/BundleRegistry.js index 3a4e644fbb..9c6a714944 100644 --- a/src/BundleRegistry.js +++ b/src/BundleRegistry.js @@ -28,7 +28,7 @@ define(function () { } BundleRegistry.prototype.register = function (path, definition) { - if (this.knownBundles.hasOwnProperty(path)) { + if (Object.prototype.hasOwnProperty.call(this.knownBundles, path)) { throw new Error('Cannot register bundle with duplicate path', path); } diff --git a/src/adapter/policies/AdaptedViewPolicy.js b/src/adapter/policies/AdaptedViewPolicy.js index 8cd18205bb..85b0e45036 100644 --- a/src/adapter/policies/AdaptedViewPolicy.js +++ b/src/adapter/policies/AdaptedViewPolicy.js @@ -29,7 +29,7 @@ define([], function () { view, legacyObject ) { - if (view.hasOwnProperty('provider')) { + if (Object.prototype.hasOwnProperty.call(view, 'provider')) { var domainObject = legacyObject.useCapability('adapter'); return view.provider.canView(domainObject); diff --git a/src/adapter/runs/TypeDeprecationChecker.js b/src/adapter/runs/TypeDeprecationChecker.js index ff3e42be22..d96ac5df18 100644 --- a/src/adapter/runs/TypeDeprecationChecker.js +++ b/src/adapter/runs/TypeDeprecationChecker.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open openmct, Copyright (c) 2014-2018, United States Government + * Open openmct, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -20,7 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/* global console */ define([ ], function ( @@ -28,7 +27,7 @@ define([ ) { function checkForDeprecatedFunctionality(typeDef) { - if (typeDef.hasOwnProperty('telemetry')) { + if (Object.prototype.hasOwnProperty.call(typeDef, 'telemetry')) { console.warn( 'DEPRECATION WARNING: Telemetry data on type ' + 'registrations will be deprecated in a future version, ' diff --git a/src/adapter/views/installLegacyViews.js b/src/adapter/views/installLegacyViews.js index 636e6b7e8d..86419a09c9 100644 --- a/src/adapter/views/installLegacyViews.js +++ b/src/adapter/views/installLegacyViews.js @@ -21,7 +21,7 @@ define([ }); let inspectorTypes = openmct.$injector.get('types[]') - .filter((t) => t.hasOwnProperty('inspector')); + .filter((t) => Object.prototype.hasOwnProperty.call(t, 'inspector')); inspectorTypes.forEach(function (typeDefinition) { openmct.inspectorViews.addProvider(new TypeInspectorViewProvider(typeDefinition, openmct, convertToLegacyObject)); diff --git a/src/api/notifications/NotificationAPI.js b/src/api/notifications/NotificationAPI.js index 84c0a2455b..950102a74d 100644 --- a/src/api/notifications/NotificationAPI.js +++ b/src/api/notifications/NotificationAPI.js @@ -299,7 +299,7 @@ export default class NotificationAPI extends EventEmitter { this._dismiss(notification); }; - if (notificationModel.hasOwnProperty('progressPerc')) { + if (Object.prototype.hasOwnProperty.call(notificationModel, 'progressPerc')) { notification.progress = (progressPerc, progressText) => { notification.model.progressPerc = progressPerc; notification.model.progressText = progressText; diff --git a/src/api/objects/object-utils.js b/src/api/objects/object-utils.js index bfe5830afd..8237804799 100644 --- a/src/api/objects/object-utils.js +++ b/src/api/objects/object-utils.js @@ -32,8 +32,8 @@ define([ */ function isIdentifier(thing) { return typeof thing === 'object' - && thing.hasOwnProperty('key') - && thing.hasOwnProperty('namespace'); + && Object.prototype.hasOwnProperty.call(thing, 'key') + && Object.prototype.hasOwnProperty.call(thing, 'namespace'); } /** diff --git a/src/api/telemetry/TelemetryAPI.js b/src/api/telemetry/TelemetryAPI.js index 0937a3c639..a5f0f4fc09 100644 --- a/src/api/telemetry/TelemetryAPI.js +++ b/src/api/telemetry/TelemetryAPI.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global console*/ + define([ './TelemetryMetadataManager', './TelemetryValueFormatter', @@ -247,15 +247,15 @@ define([ * @private */ TelemetryAPI.prototype.standardizeRequestOptions = function (options) { - if (!options.hasOwnProperty('start')) { + if (!Object.prototype.hasOwnProperty.call(options, 'start')) { options.start = this.openmct.time.bounds().start; } - if (!options.hasOwnProperty('end')) { + if (!Object.prototype.hasOwnProperty.call(options, 'end')) { options.end = this.openmct.time.bounds().end; } - if (!options.hasOwnProperty('domain')) { + if (!Object.prototype.hasOwnProperty.call(options, 'domain')) { options.domain = this.openmct.time.timeSystem().key; } }; @@ -386,7 +386,7 @@ define([ }).reduce(function (a, b) { var results = {}; Object.keys(a).forEach(function (key) { - if (b.hasOwnProperty(key)) { + if (Object.prototype.hasOwnProperty.call(b, key)) { results[key] = a[key]; } }); diff --git a/src/api/telemetry/TelemetryMetadataManager.js b/src/api/telemetry/TelemetryMetadataManager.js index 75e0de8272..5040acbfa3 100644 --- a/src/api/telemetry/TelemetryMetadataManager.js +++ b/src/api/telemetry/TelemetryMetadataManager.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global console*/ define([ 'lodash' @@ -31,26 +30,26 @@ define([ valueMetadata.source = valueMetadata.source || valueMetadata.key; valueMetadata.hints = valueMetadata.hints || {}; - if (valueMetadata.hints.hasOwnProperty('x')) { + if (Object.prototype.hasOwnProperty.call(valueMetadata.hints, 'x')) { console.warn( 'DEPRECATION WARNING: `x` hints should be replaced with ' + '`domain` hints moving forward. ' + 'https://github.com/nasa/openmct/issues/1546' ); - if (!valueMetadata.hints.hasOwnProperty('domain')) { + if (!Object.prototype.hasOwnProperty.call(valueMetadata.hints, 'domain')) { valueMetadata.hints.domain = valueMetadata.hints.x; } delete valueMetadata.hints.x; } - if (valueMetadata.hints.hasOwnProperty('y')) { + if (Object.prototype.hasOwnProperty.call(valueMetadata.hints, 'y')) { console.warn( 'DEPRECATION WARNING: `y` hints should be replaced with ' + '`range` hints moving forward. ' + 'https://github.com/nasa/openmct/issues/1546' ); - if (!valueMetadata.hints.hasOwnProperty('range')) { + if (!Object.prototype.hasOwnProperty.call(valueMetadata.hints, 'range')) { valueMetadata.hints.range = valueMetadata.hints.y; } @@ -62,16 +61,16 @@ define([ valueMetadata.values = valueMetadata.enumerations.map(e => e.value); } - if (!valueMetadata.hasOwnProperty('max')) { + if (!Object.prototype.hasOwnProperty.call(valueMetadata, 'max')) { valueMetadata.max = Math.max(valueMetadata.values) + 1; } - if (!valueMetadata.hasOwnProperty('min')) { + if (!Object.prototype.hasOwnProperty.call(valueMetadata, 'min')) { valueMetadata.min = Math.min(valueMetadata.values) - 1; } } - if (!valueMetadata.hints.hasOwnProperty('priority')) { + if (!Object.prototype.hasOwnProperty.call(valueMetadata.hints, 'priority')) { valueMetadata.hints.priority = index; } @@ -115,7 +114,7 @@ define([ ) { function hasHint(hint) { // eslint-disable-next-line no-invalid-this - return this.hints.hasOwnProperty(hint); + return Object.prototype.hasOwnProperty.call(this.hints, hint); } function hasHints(metadata) { diff --git a/src/api/telemetry/TelemetryValueFormatter.js b/src/api/telemetry/TelemetryValueFormatter.js index 02b126136d..c6adda9bd7 100644 --- a/src/api/telemetry/TelemetryValueFormatter.js +++ b/src/api/telemetry/TelemetryValueFormatter.js @@ -63,7 +63,7 @@ define([ byString: {} }); this.formatter.format = function (value) { - if (this.enumerations.byValue.hasOwnProperty(value)) { + if (Object.prototype.hasOwnProperty.call(this.enumerations.byValue, value)) { return this.enumerations.byValue[value]; } @@ -71,7 +71,7 @@ define([ }.bind(this); this.formatter.parse = function (string) { if (typeof string === "string") { - if (this.enumerations.byString.hasOwnProperty(string)) { + if (Object.prototype.hasOwnProperty.call(this.enumerations.byString, string)) { return this.enumerations.byString[string]; } } diff --git a/src/api/types/TypeRegistry.js b/src/api/types/TypeRegistry.js index 2fb52fb9fa..66411ab90e 100644 --- a/src/api/types/TypeRegistry.js +++ b/src/api/types/TypeRegistry.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global console*/ define(['./Type'], function (Type) { /** @@ -63,7 +62,7 @@ define(['./Type'], function (Type) { * @private */ TypeRegistry.prototype.standardizeType = function (typeDef) { - if (typeDef.hasOwnProperty('label')) { + if (Object.prototype.hasOwnProperty.call(typeDef, 'label')) { console.warn( 'DEPRECATION WARNING typeDef: ' + typeDef.label + '. ' + '`label` is deprecated in type definitions. Please use ' diff --git a/src/plugins/condition/ConditionManager.js b/src/plugins/condition/ConditionManager.js index abb3ffb24f..165aa92b2a 100644 --- a/src/plugins/condition/ConditionManager.js +++ b/src/plugins/condition/ConditionManager.js @@ -303,7 +303,7 @@ export default class ConditionManager extends EventEmitter { isTelemetryUsed(endpoint) { const id = this.openmct.objects.makeKeyString(endpoint.identifier); - for (const condition of this.conditions) { + for (let condition of this.conditions) { if (condition.isTelemetryUsed(id)) { return true; } diff --git a/src/plugins/condition/components/Criterion.vue b/src/plugins/condition/components/Criterion.vue index fb317e4db1..bca84eb14c 100644 --- a/src/plugins/condition/components/Criterion.vue +++ b/src/plugins/condition/components/Criterion.vue @@ -213,9 +213,9 @@ export default { this.enumerations = foundMetadata.enumerations; } else if (foundMetadata.format === 'string' || foundMetadata.format === 'number') { this.operationFormat = foundMetadata.format; - } else if (foundMetadata.hints.hasOwnProperty('range')) { + } else if (Object.prototype.hasOwnProperty.call(foundMetadata.hints, 'range')) { this.operationFormat = 'number'; - } else if (foundMetadata.hints.hasOwnProperty('domain')) { + } else if (Object.prototype.hasOwnProperty.call(foundMetadata.hints, 'domain')) { this.operationFormat = 'number'; } else if (foundMetadata.key === 'name') { this.operationFormat = 'string'; diff --git a/src/plugins/condition/utils/evaluator.js b/src/plugins/condition/utils/evaluator.js index 831de2d950..1202a2577c 100644 --- a/src/plugins/condition/utils/evaluator.js +++ b/src/plugins/condition/utils/evaluator.js @@ -34,7 +34,7 @@ export function evaluateResults(results, trigger) { } function matchAll(results) { - for (const result of results) { + for (let result of results) { if (result !== true) { return false; } @@ -44,7 +44,7 @@ function matchAll(results) { } function matchAny(results) { - for (const result of results) { + for (let result of results) { if (result === true) { return true; } @@ -55,7 +55,7 @@ function matchAny(results) { function matchExact(results, target) { let matches = 0; - for (const result of results) { + for (let result of results) { if (result === true) { matches++; } diff --git a/src/plugins/displayLayout/components/DisplayLayout.vue b/src/plugins/displayLayout/components/DisplayLayout.vue index 88c599a706..322d6efbbe 100644 --- a/src/plugins/displayLayout/components/DisplayLayout.vue +++ b/src/plugins/displayLayout/components/DisplayLayout.vue @@ -375,8 +375,8 @@ export default { .filter(type => type.startsWith(DRAG_OBJECT_TRANSFER_PREFIX)) .map(type => type.substring(DRAG_OBJECT_TRANSFER_PREFIX.length))[0]; - // If the layout already contains the given object, then shortcut the default dragover behavior and - // potentially allow drop. Display layouts allow drag drop of duplicate telemetry objects. + // If the layout already contains the given object, then shortcut the default dragover behavior and + // potentially allow drop. Display layouts allow drag drop of duplicate telemetry objects. if (this.containsObject(draggedKeyString)) { $event.preventDefault(); } diff --git a/src/plugins/notebook/snapshot-container.js b/src/plugins/notebook/snapshot-container.js index 960b4ebde0..fdca98c229 100644 --- a/src/plugins/notebook/snapshot-container.js +++ b/src/plugins/notebook/snapshot-container.js @@ -14,6 +14,7 @@ export default class SnapshotContainer extends EventEmitter { this.openmct = openmct; + // eslint-disable-next-line return SnapshotContainer.instance; } diff --git a/src/plugins/plot/plugin.js b/src/plugins/plot/plugin.js index 322bbbe2fe..8cfc11f421 100644 --- a/src/plugins/plot/plugin.js +++ b/src/plugins/plot/plugin.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -20,8 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global define*/ - define([ "./src/chart/MCTChartDirective", "./src/plot/MCTPlotDirective", diff --git a/src/plugins/plot/src/chart/MCTChartAlarmPointSet.js b/src/plugins/plot/src/chart/MCTChartAlarmPointSet.js index 6550214955..fe87e472e8 100644 --- a/src/plugins/plot/src/chart/MCTChartAlarmPointSet.js +++ b/src/plugins/plot/src/chart/MCTChartAlarmPointSet.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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([ '../lib/extend', diff --git a/src/plugins/plot/src/chart/MCTChartController.js b/src/plugins/plot/src/chart/MCTChartController.js index 32654ddbf3..c2c06dea3f 100644 --- a/src/plugins/plot/src/chart/MCTChartController.js +++ b/src/plugins/plot/src/chart/MCTChartController.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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,requestAnimationFrame,Float32Array*/ /** * Module defining MCTChart. Created by vwoeltje on 11/12/14. diff --git a/src/plugins/plot/src/chart/MCTChartDirective.js b/src/plugins/plot/src/chart/MCTChartDirective.js index 3f3574dc42..69632e2131 100644 --- a/src/plugins/plot/src/chart/MCTChartDirective.js +++ b/src/plugins/plot/src/chart/MCTChartDirective.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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*/ /** * Module defining MCTChart. Created by vwoeltje on 11/12/14. diff --git a/src/plugins/plot/src/chart/MCTChartLineLinear.js b/src/plugins/plot/src/chart/MCTChartLineLinear.js index 1db828adfd..b7dea64415 100644 --- a/src/plugins/plot/src/chart/MCTChartLineLinear.js +++ b/src/plugins/plot/src/chart/MCTChartLineLinear.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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([ './MCTChartSeriesElement' diff --git a/src/plugins/plot/src/chart/MCTChartLineStepAfter.js b/src/plugins/plot/src/chart/MCTChartLineStepAfter.js index 53be553767..c8f37c48b4 100644 --- a/src/plugins/plot/src/chart/MCTChartLineStepAfter.js +++ b/src/plugins/plot/src/chart/MCTChartLineStepAfter.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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([ './MCTChartSeriesElement' diff --git a/src/plugins/plot/src/chart/MCTChartPointSet.js b/src/plugins/plot/src/chart/MCTChartPointSet.js index 92913fa92f..2e593442d6 100644 --- a/src/plugins/plot/src/chart/MCTChartPointSet.js +++ b/src/plugins/plot/src/chart/MCTChartPointSet.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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([ './MCTChartSeriesElement' diff --git a/src/plugins/plot/src/chart/MCTChartSeriesElement.js b/src/plugins/plot/src/chart/MCTChartSeriesElement.js index 050117ae91..fd8e5642e3 100644 --- a/src/plugins/plot/src/chart/MCTChartSeriesElement.js +++ b/src/plugins/plot/src/chart/MCTChartSeriesElement.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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,Float32Array*/ define([ '../lib/extend', diff --git a/src/plugins/plot/src/configuration/Collection.js b/src/plugins/plot/src/configuration/Collection.js index a516904f30..b6f427564c 100644 --- a/src/plugins/plot/src/configuration/Collection.js +++ b/src/plugins/plot/src/configuration/Collection.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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([ 'EventEmitter', diff --git a/src/plugins/plot/src/configuration/Model.js b/src/plugins/plot/src/configuration/Model.js index 6691638552..8a6cc80984 100644 --- a/src/plugins/plot/src/configuration/Model.js +++ b/src/plugins/plot/src/configuration/Model.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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([ 'lodash', diff --git a/src/plugins/plot/src/configuration/PlotConfigurationModel.js b/src/plugins/plot/src/configuration/PlotConfigurationModel.js index 8665093ebe..9fcd2719f7 100644 --- a/src/plugins/plot/src/configuration/PlotConfigurationModel.js +++ b/src/plugins/plot/src/configuration/PlotConfigurationModel.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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([ './Collection', diff --git a/src/plugins/plot/src/configuration/PlotSeries.js b/src/plugins/plot/src/configuration/PlotSeries.js index 08775ab6b5..b9eceb47b8 100644 --- a/src/plugins/plot/src/configuration/PlotSeries.js +++ b/src/plugins/plot/src/configuration/PlotSeries.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -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([ 'lodash', diff --git a/src/plugins/plot/src/draw/DrawLoader.js b/src/plugins/plot/src/draw/DrawLoader.js index f03d2d3d02..9d776db36f 100644 --- a/src/plugins/plot/src/draw/DrawLoader.js +++ b/src/plugins/plot/src/draw/DrawLoader.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/* global console */ define( [ diff --git a/src/plugins/plot/src/inspector/PlotEditRegion.js b/src/plugins/plot/src/inspector/PlotEditRegion.js index 8ba27ff0ed..23419dead3 100644 --- a/src/plugins/plot/src/inspector/PlotEditRegion.js +++ b/src/plugins/plot/src/inspector/PlotEditRegion.js @@ -1,4 +1,25 @@ -/*global define*/ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2020, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open openmct is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open openmct includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ + define([ './Region' ], function ( diff --git a/src/plugins/plot/src/lib/color.js b/src/plugins/plot/src/lib/color.js index f86b79adf5..04e29278d9 100644 --- a/src/plugins/plot/src/lib/color.js +++ b/src/plugins/plot/src/lib/color.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/* global console */ define(function () { diff --git a/src/plugins/plot/src/lib/extend.js b/src/plugins/plot/src/lib/extend.js index dbc95a8bc7..3cf7daa686 100644 --- a/src/plugins/plot/src/lib/extend.js +++ b/src/plugins/plot/src/lib/extend.js @@ -33,7 +33,7 @@ define([ child, Surrogate; - if (props && props.hasOwnProperty('constructor')) { + if (props && Object.prototype.hasOwnProperty.call(props, 'constructor')) { child = props.constructor; } else { child = function () { diff --git a/src/plugins/plot/src/services/ExportImageService.js b/src/plugins/plot/src/services/ExportImageService.js index 27c644dd59..862e93ca4e 100644 --- a/src/plugins/plot/src/services/ExportImageService.js +++ b/src/plugins/plot/src/services/ExportImageService.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/* global console*/ + /** * Module defining ExportImageService. Created by hudsonfoo on 09/02/16 */ diff --git a/src/plugins/plot/src/telemetry/StackedPlotController.js b/src/plugins/plot/src/telemetry/StackedPlotController.js index a6c286ace5..4ca7a10d4e 100644 --- a/src/plugins/plot/src/telemetry/StackedPlotController.js +++ b/src/plugins/plot/src/telemetry/StackedPlotController.js @@ -122,7 +122,7 @@ define([], function () { $scope.$on('plot:tickWidth', function ($e, width) { const plotId = $e.targetScope.domainObject.getId(); - if (!tickWidthMap.hasOwnProperty(plotId)) { + if (!Object.prototype.hasOwnProperty.call(tickWidthMap, plotId)) { return; } diff --git a/src/plugins/summaryWidget/src/ConditionManager.js b/src/plugins/summaryWidget/src/ConditionManager.js index 4b0c9e866d..6e7eaf07e2 100644 --- a/src/plugins/summaryWidget/src/ConditionManager.js +++ b/src/plugins/summaryWidget/src/ConditionManager.js @@ -9,8 +9,7 @@ define ([ objectUtils, EventEmitter, $, - _, - + _ ) { /** @@ -133,9 +132,9 @@ define ([ var type; if (valueMetadata.enumerations !== undefined) { type = 'enum'; - } else if (valueMetadata.hints.hasOwnProperty('range')) { + } else if (Object.prototype.hasOwnProperty.call(valueMetadata.hints, 'range')) { type = 'number'; - } else if (valueMetadata.hints.hasOwnProperty('domain')) { + } else if (Object.prototype.hasOwnProperty.call(valueMetadata.hints, 'domain')) { type = 'number'; } else if (valueMetadata.key === 'name') { type = 'string'; diff --git a/src/plugins/summaryWidget/src/eventHelpers.js b/src/plugins/summaryWidget/src/eventHelpers.js index 559d1d8b0e..433010b948 100644 --- a/src/plugins/summaryWidget/src/eventHelpers.js +++ b/src/plugins/summaryWidget/src/eventHelpers.js @@ -1,5 +1,25 @@ -/*global define*/ -// jscs:disable disallowDanglingUnderscores +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2020, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open MCT is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open MCT includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ + define([], function () { var helperFunctions = { listenTo: function (object, event, callback, context) { diff --git a/src/plugins/telemetryMean/src/MeanTelemetryProvider.js b/src/plugins/telemetryMean/src/MeanTelemetryProvider.js index e85a6fcef1..7669712924 100644 --- a/src/plugins/telemetryMean/src/MeanTelemetryProvider.js +++ b/src/plugins/telemetryMean/src/MeanTelemetryProvider.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,8 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*jshint latedef: nofunc */ -/*global console */ + define([ 'objectUtils', './TelemetryAverager' diff --git a/src/plugins/telemetryMean/src/MockTelemetryApi.js b/src/plugins/telemetryMean/src/MockTelemetryApi.js index 99e3f76b29..2ee71ab406 100644 --- a/src/plugins/telemetryMean/src/MockTelemetryApi.js +++ b/src/plugins/telemetryMean/src/MockTelemetryApi.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global jasmine, spyOn */ + define([], function () { function MockTelemetryApi() { diff --git a/src/plugins/telemetryTable/TelemetryTable.js b/src/plugins/telemetryTable/TelemetryTable.js index fcae5b6071..fe907bf2e5 100644 --- a/src/plugins/telemetryTable/TelemetryTable.js +++ b/src/plugins/telemetryTable/TelemetryTable.js @@ -270,7 +270,7 @@ define([ } isTelemetryObject(domainObject) { - return domainObject.hasOwnProperty('telemetry'); + return Object.prototype.hasOwnProperty.call(domainObject, 'telemetry'); } buildOptionsFromConfiguration(telemetryObject) { diff --git a/src/plugins/telemetryTable/TelemetryTableColumn.js b/src/plugins/telemetryTable/TelemetryTableColumn.js index 4870f71ab5..5d48c88974 100644 --- a/src/plugins/telemetryTable/TelemetryTableColumn.js +++ b/src/plugins/telemetryTable/TelemetryTableColumn.js @@ -41,7 +41,7 @@ define(function () { } hasValueForDatum(telemetryDatum) { - return telemetryDatum.hasOwnProperty(this.metadatum.source); + return Object.prototype.hasOwnProperty.call(telemetryDatum, this.metadatum.source); } getRawValue(telemetryDatum) { diff --git a/src/plugins/telemetryTable/TelemetryTableViewProvider.js b/src/plugins/telemetryTable/TelemetryTableViewProvider.js index b6e3d810db..8edc838a74 100644 --- a/src/plugins/telemetryTable/TelemetryTableViewProvider.js +++ b/src/plugins/telemetryTable/TelemetryTableViewProvider.js @@ -31,7 +31,7 @@ define([ ) { function TelemetryTableViewProvider(openmct) { function hasTelemetry(domainObject) { - if (!domainObject.hasOwnProperty('telemetry')) { + if (!Object.prototype.hasOwnProperty.call(domainObject, 'telemetry')) { return false; } diff --git a/src/plugins/telemetryTable/collections/FilteredTableRowCollection.js b/src/plugins/telemetryTable/collections/FilteredTableRowCollection.js index 66e542f651..d46feff460 100644 --- a/src/plugins/telemetryTable/collections/FilteredTableRowCollection.js +++ b/src/plugins/telemetryTable/collections/FilteredTableRowCollection.js @@ -104,7 +104,7 @@ define( } rowHasColumn(row, key) { - return row.columns.hasOwnProperty(key); + return Object.prototype.hasOwnProperty.call(row.columns, key); } destroy() { diff --git a/src/plugins/telemetryTable/plugin.js b/src/plugins/telemetryTable/plugin.js index 8a56336dc3..815993dc8b 100644 --- a/src/plugins/telemetryTable/plugin.js +++ b/src/plugins/telemetryTable/plugin.js @@ -36,7 +36,7 @@ define([ openmct.types.addType('table', TelemetryTableType); openmct.composition.addPolicy((parent, child) => { if (parent.type === 'table') { - return child.hasOwnProperty('telemetry'); + return Object.prototype.hasOwnProperty.call(child, 'telemetry'); } else { return true; } diff --git a/src/ui/registries/InspectorViewRegistry.js b/src/ui/registries/InspectorViewRegistry.js index 8c68af2470..b969872ca9 100644 --- a/src/ui/registries/InspectorViewRegistry.js +++ b/src/ui/registries/InspectorViewRegistry.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global console */ define([], function () { diff --git a/src/ui/registries/ToolbarRegistry.js b/src/ui/registries/ToolbarRegistry.js index fcab309999..0872010e35 100644 --- a/src/ui/registries/ToolbarRegistry.js +++ b/src/ui/registries/ToolbarRegistry.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2017, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global console */ define([], function () { diff --git a/src/ui/registries/ViewRegistry.js b/src/ui/registries/ViewRegistry.js index f2395632d0..0ccff56502 100644 --- a/src/ui/registries/ViewRegistry.js +++ b/src/ui/registries/ViewRegistry.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global console */ define(['EventEmitter'], function (EventEmitter) { const DEFAULT_VIEW_PRIORITY = 100; diff --git a/src/ui/router/ApplicationRouter.js b/src/ui/router/ApplicationRouter.js index 1d60b5fe34..2a8c3ecc21 100644 --- a/src/ui/router/ApplicationRouter.js +++ b/src/ui/router/ApplicationRouter.js @@ -1,9 +1,25 @@ -/** - -Application router -- must - -*/ -/*global _,module*/ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2020, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open MCT is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open MCT includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ +/*global module*/ const LocationBar = require('location-bar'); const EventEmitter = require('EventEmitter'); @@ -124,18 +140,16 @@ class ApplicationRouter extends EventEmitter { doParamsChange(newParams, oldParams, newLocation) { let changedParams = {}; - for (let [key, value] of Object.entries(newParams)) { + Object.entries(newParams).forEach(([key, value]) => { if (value !== oldParams[key]) { changedParams[key] = value; } - } - - for (let key of Object.keys(oldParams)) { - if (!newParams.hasOwnProperty(key)) { + }); + Object.keys(oldParams).forEach(key => { + if (!Object.prototype.hasOwnProperty.call(newParams, key)) { changedParams[key] = undefined; } - } - + }); this.emit('change:params', newParams, oldParams, changedParams); } @@ -144,14 +158,13 @@ class ApplicationRouter extends EventEmitter { */ updateParams(updateParams) { let searchParams = this.currentLocation.url.searchParams; - for (let [key, value] of Object.entries(updateParams)) { + Object.entries(updateParams).forEach(([key, value]) => { if (typeof value === 'undefined') { searchParams.delete(key); } else { searchParams.set(key, value); } - } - + }); this.setQueryString(searchParams.toString()); } diff --git a/src/ui/toolbar/Toolbar.vue b/src/ui/toolbar/Toolbar.vue index ce2477d95b..9c983e9060 100644 --- a/src/ui/toolbar/Toolbar.vue +++ b/src/ui/toolbar/Toolbar.vue @@ -179,7 +179,7 @@ export default { } }); - for (const key in values) { + for (let key in values) { if (values[key].every(val => val === values[key][0])) { value[key] = values[key][0]; toolbarItem.nonSpecific = false;