ESLint one-var, no-var rules (#3239)

* fixed issues for eslint one-var and no-var rules

Co-authored-by: Joshi <simplyrender@gmail.com>
Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
Joel McKinnon
2020-08-10 12:13:23 -07:00
committed by GitHub
parent 4d560086dd
commit c6ca912f2b
193 changed files with 1601 additions and 1541 deletions

View File

@ -10,11 +10,11 @@ define([
* exist in the same namespace as the rootIdentifier.
*/
function rewriteObjectIdentifiers(importData, rootIdentifier) {
var rootId = importData.rootId;
var objectString = JSON.stringify(importData.openmct);
const rootId = importData.rootId;
let objectString = JSON.stringify(importData.openmct);
Object.keys(importData.openmct).forEach(function (originalId, i) {
var newId;
let newId;
if (originalId === rootId) {
newId = objectUtils.makeKeyString(rootIdentifier);
} else {
@ -60,8 +60,8 @@ define([
* an object provider to fetch those objects.
*/
function StaticModelProvider(importData, rootIdentifier) {
var oldFormatObjectMap = rewriteObjectIdentifiers(importData, rootIdentifier);
var newFormatObjectMap = convertToNewObjects(oldFormatObjectMap);
const oldFormatObjectMap = rewriteObjectIdentifiers(importData, rootIdentifier);
const newFormatObjectMap = convertToNewObjects(oldFormatObjectMap);
this.objectMap = setRootLocation(newFormatObjectMap, rootIdentifier);
}
@ -69,7 +69,7 @@ define([
* Standard "Get".
*/
StaticModelProvider.prototype.get = function (identifier) {
var keyString = objectUtils.makeKeyString(identifier);
const keyString = objectUtils.makeKeyString(identifier);
if (this.objectMap[keyString]) {
return this.objectMap[keyString];
}

View File

@ -8,10 +8,10 @@ define([
describe('StaticModelProvider', function () {
var staticProvider;
let staticProvider;
beforeEach(function () {
var staticData = JSON.parse(JSON.stringify(testStaticData));
const staticData = JSON.parse(JSON.stringify(testStaticData));
staticProvider = new StaticModelProvider(staticData, {
namespace: 'my-import',
key: 'root'
@ -19,7 +19,7 @@ define([
});
describe('rootObject', function () {
var rootModel;
let rootModel;
beforeEach(function () {
rootModel = staticProvider.get({
@ -52,9 +52,9 @@ define([
});
describe('childObjects', function () {
var swg;
var layout;
var fixed;
let swg;
let layout;
let fixed;
beforeEach(function () {
swg = staticProvider.get({

View File

@ -9,12 +9,12 @@ define([
*/
function StaticRootPlugin(namespace, exportUrl) {
var rootIdentifier = {
const rootIdentifier = {
namespace: namespace,
key: 'root'
};
var cachedProvider;
let cachedProvider;
function loadProvider() {
return fetch(exportUrl)