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

@ -67,7 +67,7 @@ define(['EventEmitter'], function (EventEmitter) {
* @private
*/
LocalClock.prototype.tick = function () {
var now = Date.now();
const now = Date.now();
this.emit("tick", now);
this.lastTick = now;
this.timeoutHandle = setTimeout(this.tick.bind(this), this.period);
@ -81,7 +81,7 @@ define(['EventEmitter'], function (EventEmitter) {
* @returns {function} a function for deregistering the provided listener
*/
LocalClock.prototype.on = function (event) {
var result = EventEmitter.prototype.on.apply(this, arguments);
const result = EventEmitter.prototype.on.apply(this, arguments);
if (this.listeners(event).length === 1) {
this.start();
@ -98,7 +98,7 @@ define(['EventEmitter'], function (EventEmitter) {
* @returns {function} a function for deregistering the provided listener
*/
LocalClock.prototype.off = function (event) {
var result = EventEmitter.prototype.off.apply(this, arguments);
const result = EventEmitter.prototype.off.apply(this, arguments);
if (this.listeners(event).length === 0) {
this.stop();

View File

@ -22,9 +22,9 @@
define(["./LocalClock"], function (LocalClock) {
describe("The LocalClock class", function () {
var clock,
mockTimeout,
timeoutHandle = {};
let clock;
let mockTimeout;
const timeoutHandle = {};
beforeEach(function () {
mockTimeout = jasmine.createSpy("timeout");
@ -35,7 +35,7 @@ define(["./LocalClock"], function (LocalClock) {
});
it("calls listeners on tick with current time", function () {
var mockListener = jasmine.createSpy("listener");
const mockListener = jasmine.createSpy("listener");
clock.on('tick', mockListener);
clock.tick();
expect(mockListener).toHaveBeenCalledWith(jasmine.any(Number));

View File

@ -22,8 +22,8 @@
define(['./UTCTimeSystem'], function (UTCTimeSystem) {
describe("The UTCTimeSystem class", function () {
var timeSystem,
mockTimeout;
let timeSystem;
let mockTimeout;
beforeEach(function () {
mockTimeout = jasmine.createSpy("timeout");

View File

@ -33,7 +33,7 @@ define([
*/
return function () {
return function (openmct) {
var timeSystem = new UTCTimeSystem();
const timeSystem = new UTCTimeSystem();
openmct.time.addTimeSystem(timeSystem);
openmct.time.addClock(new LocalClock(100));
};