mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 22:49:18 +00:00
configure lint staged (#588)
* chore: upgrade monorepo deps * chore: configure lint-staged * refactor: lenient use of any
This commit is contained in:
@@ -5,5 +5,8 @@
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2020,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"globals": {
|
||||
"globalThis": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,17 +27,17 @@
|
||||
"@types/node": "^16.11.7",
|
||||
"@types/node-osc": "^6.0.2",
|
||||
"@types/websocket": "^1.0.5",
|
||||
"@typescript-eslint/eslint-plugin": "^5.48.1",
|
||||
"@typescript-eslint/parser": "^5.48.1",
|
||||
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
||||
"@typescript-eslint/parser": "^6.10.0",
|
||||
"esbuild": "^0.17.5",
|
||||
"eslint": "^8.31.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint": "^8.53.0",
|
||||
"eslint-plugin-prettier": "^5.0.1",
|
||||
"nodemon": "^2.0.20",
|
||||
"ontime-types": "workspace:*",
|
||||
"prettier": "^2.8.3",
|
||||
"prettier": "^3.0.3",
|
||||
"shx": "^0.3.4",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.9.4",
|
||||
"typescript": "^5.2.2",
|
||||
"vitest": "^0.30.1"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { socket } from './WebsocketAdapter.js';
|
||||
* Utility function to notify clients that the REST data is stale
|
||||
* @param payload -- possible patch payload
|
||||
*/
|
||||
export function sendRefetch(payload: any | null = null) {
|
||||
export function sendRefetch(payload: unknown = null) {
|
||||
socket.sendAsJson({
|
||||
type: 'ontime-refetch',
|
||||
payload,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { Playback } from 'ontime-types';
|
||||
|
||||
@@ -3,11 +3,11 @@ import { deepmerge } from 'ontime-utils';
|
||||
|
||||
/**
|
||||
* @description Ensures variable is string, it skips object types
|
||||
* @param {any} val - variable to convert
|
||||
* @param val - variable to convert
|
||||
* @param {string} [fallback=''] - fallback value
|
||||
* @returns {string} - value as string or fallback if not possible
|
||||
*/
|
||||
export const makeString = (val: any, fallback = ''): string => {
|
||||
export const makeString = (val: unknown, fallback = ''): string => {
|
||||
if (typeof val === 'string') return val;
|
||||
else if (val == null || val.constructor === Object) return fallback;
|
||||
return val.toString();
|
||||
@@ -56,7 +56,7 @@ export const isEmptyObject = (obj: object) => {
|
||||
* @param {object} a - any object
|
||||
* @param {object} b - a potential partial object of same time as a
|
||||
*/
|
||||
export function mergeObject<T extends Record<string, any>>(a: T, b: Partial<Record<keyof T, any>>): T {
|
||||
export function mergeObject<T extends object>(a: T, b: Partial<T>): T {
|
||||
const merged = { ...a };
|
||||
|
||||
for (const key in b) {
|
||||
|
||||
Reference in New Issue
Block a user