chore: configure project wide linter (#577)

* chore(lint): configure project-wide linter

* chore(lint): improve linting in files

* chore(lint): hide warnings in CI
This commit is contained in:
Carlos Valente
2023-11-07 22:30:39 +01:00
committed by GitHub
parent 943dd19c09
commit 2c47d90f34
38 changed files with 138 additions and 171 deletions
@@ -30,7 +30,7 @@ const whitelistedPayload = {
};
export function parse(field: string, value: unknown) {
if (!whitelistedPayload.hasOwnProperty(field)) {
if (!Object.hasOwn(whitelistedPayload, field)) {
throw new Error(`Field ${field} not permitted`);
}
const parserFn = whitelistedPayload[field];
@@ -51,7 +51,7 @@ export function updateEvent(
const event = EventLoader.getEventWithId(eventId);
if (event) {
let propertiesToUpdate = { [propertyName]: newValue };
const propertiesToUpdate = { [propertyName]: newValue };
// Handles the special case for duration
// needs to be converted to milliseconds
@@ -14,7 +14,7 @@ export function dispatchFromAdapter(
payload: unknown;
params?: Array<string>;
},
source?: 'osc' | 'ws',
_source?: 'osc' | 'ws',
) {
const payload = args.payload;
const typeComponents = type.toLowerCase().split('/');
@@ -1,6 +1,7 @@
/* eslint-disable no-console -- we are mocking the console */
import { vi } from 'vitest';
import { EndAction, TimerType } from 'ontime-types';
import { EndAction, OntimeEvent, TimerType } from 'ontime-types';
import { dbModel } from '../../models/dataModel.js';
import { parseExcel, parseJson, validateEvent } from '../parser.js';