configure lint staged (#588)

* chore: upgrade monorepo deps

* chore: configure lint-staged

* refactor: lenient use of any
This commit is contained in:
Carlos Valente
2023-11-13 22:04:55 +01:00
committed by GitHub
parent 140daef7e7
commit a41fe8806b
22 changed files with 1107 additions and 514 deletions
+8 -9
View File
@@ -63,17 +63,16 @@
"@testing-library/react": "^13.1.1",
"@testing-library/user-event": "^14.1.1",
"@types/color": "^3.0.3",
"@types/luxon": "^3.2.0",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"@types/testing-library__jest-dom": "^5.14.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",
"@vitejs/plugin-react": "^3.0.1",
"eslint": "^8.31.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-jest": "^27.1.7",
"eslint-plugin-prettier": "^4.2.1",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.32.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^8.0.0",
@@ -81,9 +80,9 @@
"jsdom": "^21.1.0",
"ontime-types": "workspace:*",
"ontime-utils": "workspace:*",
"prettier": "^2.8.3",
"prettier": "^3.0.3",
"sass": "^1.57.1",
"typescript": "^4.9.4",
"typescript": "^5.2.2",
"vite": "^4.3.1",
"vite-plugin-compression2": "^0.9.0",
"vite-plugin-svgr": "^2.4.0",
@@ -1,7 +1,7 @@
export default function useElectronEvent() {
const isElectron = window?.process?.type === 'renderer';
const sendToElectron = (channel: string, args?: string | Record<string, any>) => {
const sendToElectron = (channel: string, args?: string | Record<string, unknown>) => {
if (isElectron) {
window?.ipcRenderer.send(channel, args);
}
+1 -1
View File
@@ -129,7 +129,7 @@ export const socketSend = (message: any) => {
}
};
export const socketSendJson = (type: string, payload?: any) => {
export const socketSendJson = (type: string, payload?: unknown) => {
socketSend(
JSON.stringify({
type,
@@ -3,8 +3,12 @@ import { UseFormRegister } from 'react-hook-form';
import { IconButton, Input, InputGroup, InputRightElement } from '@chakra-ui/react';
import { IoEyeOutline } from '@react-icons/all-files/io5/IoEyeOutline';
interface FormInput {
[key: string]: string;
}
interface ModalPinInputProps {
register: UseFormRegister<any>;
register: UseFormRegister<FormInput>;
formName: string;
isDisabled?: boolean;
}
@@ -13,7 +13,7 @@ import { EventItemActions } from '../../RundownEntry';
interface BlockActionMenuProps {
enableDelete?: boolean;
showClone?: boolean;
actionHandler: (action: EventItemActions, payload?: any) => void;
actionHandler: (action: EventItemActions, payload?: unknown) => void;
className?: string;
}
+4 -1
View File
@@ -3,11 +3,14 @@
"sourceType": "module"
},
"env": {
"browser": true,
"node": true
},
"extends": [
"eslint:recommended"
],
"plugins": [],
"rules": {}
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
}
+3 -3
View File
@@ -14,9 +14,9 @@
"devDependencies": {
"electron": "^22.3.5",
"electron-builder": "^23.6.0",
"eslint": "^8.31.0",
"eslint-config-prettier": "^8.6.0",
"prettier": "^2.8.3"
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"prettier": "^3.0.3"
},
"scripts": {
"postinstall": "",
+3
View File
@@ -5,5 +5,8 @@
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"globals": {
"globalThis": false
}
}
+6 -6
View File
@@ -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": {
+1 -1
View File
@@ -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 -3
View File
@@ -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) {