Skip to content

Commit 423c810

Browse files
authored
Merge pull request #384 from smartdevicelink/bugfix/resolve-linter-issues
Fix linter issues
2 parents dd37461 + 048708c commit 423c810

5 files changed

Lines changed: 18 additions & 9 deletions

File tree

lib/js/src/manager/screen/utils/VoiceCommand.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ class VoiceCommand {
138138
if (voiceCommands.length !== otherVoiceCommands.length) {
139139
return false;
140140
}
141-
for (let i = 0; i < voiceCommands.length; i++) {
142-
if (voiceCommands[i] !== otherVoiceCommands[i]) {
141+
for (let index = 0; index < voiceCommands.length; index++) {
142+
if (voiceCommands[index] !== otherVoiceCommands[index]) {
143143
return false;
144144
}
145145
}

lib/js/src/manager/screen/utils/_VoiceCommandUpdateOperation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class _VoiceCommandUpdateOperation extends _Task {
6161
/**
6262
* The method that causes the task to run.
6363
* @param {_Task} task - The task instance
64-
* @returns {Promise}
64+
* @returns {Promise} - This promise does not resolve to any value
6565
*/
6666
async onExecute (task) {
6767
if (this.getState() === _Task.CANCELED) {

lib/js/src/protocol/_SdlPacket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import { _Bson } from './../util/_Bson.js';
3636
/**
3737
* @typedef {Object} _SdlPacket
3838
* @property {number} _EXTRA_PARCEL_DATA_LENGTH
39-
* @property @private {number} _HEADER_SIZE
39+
* @property {number} _HEADER_SIZE
4040
* @property {number} SERVICE_TYPE_CONTROL
4141
* @property {number} SERVICE_TYPE_RPC
4242
* @property {number} SERVICE_TYPE_PCM

tests/managers/screen/VoiceCommandManagerTests.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ module.exports = async function (appClient) {
4242
Validator.assertEquals(voiceCommandManager.getVoiceCommands().length, 2);
4343
Validator.assertEquals(voiceCommandManager._currentVoiceCommands.length, 0);
4444
Validator.assertEquals(voiceCommandManager._currentHmiLevel, SDL.rpc.enums.HMILevel.HMI_NONE);
45-
45+
4646
voiceCommandManager.setVoiceCommands([]); // don't operate on the voice commands when the manager gets an HMI_FULL
4747
// The VCM should send the pending voice commands once HMI full occurs
4848
// fake sending an OnHMILevel update
4949
voiceCommandManager._hmiListener(new SDL.rpc.messages.OnHMIStatus()
50-
.setHmiLevel(SDL.rpc.enums.HMILevel.HMI_FULL))
50+
.setHmiLevel(SDL.rpc.enums.HMILevel.HMI_FULL));
5151

5252
Validator.assertEquals(voiceCommandManager._currentHmiLevel, SDL.rpc.enums.HMILevel.HMI_FULL);
5353
});
@@ -62,8 +62,8 @@ module.exports = async function (appClient) {
6262
// Fake onCommand - we want to make sure that we can pass back onCommand events to our VoiceCommand Objects
6363
voiceCommandManager._commandListener(new SDL.rpc.messages.OnCommand()
6464
.setCmdID(voiceCommand3._getCommandId())
65-
.setTriggerSource(SDL.rpc.enums.TriggerSource.TS_VR)) // these are voice commands
66-
65+
.setTriggerSource(SDL.rpc.enums.TriggerSource.TS_VR)); // these are voice commands
66+
6767
// verify the mock listener has been hit once
6868
Validator.assertEquals(callback.calledOnce, true);
6969
});

tests/managers/screen/VoiceCommandUpdateOperationTests.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const Validator = require('../../Validator');
99
module.exports = function (appClient) {
1010
describe('VoiceCommandUpdateOperationTests', function () {
1111
const sdlManager = appClient._sdlManager;
12-
const voiceCommandManager = sdlManager.getScreenManager()._voiceCommandManager;
1312
const lifecycleManager = sdlManager._lifecycleManager;
1413

1514
const voiceCommand1 = new SDL.manager.screen.utils.VoiceCommand(['Command 1'], () => {});
@@ -103,6 +102,11 @@ module.exports = function (appClient) {
103102
stub.restore();
104103
});
105104

105+
/**
106+
* Will always resolve successfully
107+
* @param {AddCommand|DeleteCommand} req - The RPC to send out as a request
108+
* @returns {AddCommandResponse|DeleteCommandResponse} - The rpc returned depends on the request
109+
*/
106110
function onDeleteOrAddCommandSuccess (req) {
107111
const functionId = req.getFunctionId();
108112

@@ -120,6 +124,11 @@ module.exports = function (appClient) {
120124
}
121125
}
122126

127+
/**
128+
* Will always resolve unsuccessfully
129+
* @param {AddCommand|DeleteCommand} req - The RPC to send out as a request
130+
* @returns {AddCommandResponse|DeleteCommandResponse} - The rpc returned depends on the request
131+
*/
123132
function onDeleteOrAddCommandFails (req) {
124133
const functionId = req.getFunctionId();
125134

0 commit comments

Comments
 (0)