updates eslint config, fixes linting errors

This commit is contained in:
Mose Müller
2024-07-08 08:30:55 +02:00
parent a2ee8d02d6
commit fb251649a0
27 changed files with 1739 additions and 161 deletions

View File

@ -41,7 +41,7 @@ const serializePrimitive = (
}
};
export const serializeList = (obj: unknown[], accessPath: string = "") => {
export const serializeList = (obj: unknown[], accessPath = "") => {
const doc = null;
const value = obj.map((item, index) => {
if (
@ -65,10 +65,7 @@ export const serializeList = (obj: unknown[], accessPath: string = "") => {
doc,
};
};
export const serializeDict = (
obj: Record<string, unknown>,
accessPath: string = "",
) => {
export const serializeDict = (obj: Record<string, unknown>, accessPath = "") => {
const doc = null;
const value = Object.entries(obj).reduce(
(acc, [key, val]) => {
@ -87,7 +84,7 @@ export const serializeDict = (
return acc;
},
<Record<string, SerializedObject>>{},
{} as Record<string, SerializedObject>,
);
return {

View File

@ -1,12 +1,12 @@
import { SerializedObject } from "../types/SerializedObject";
export type State = {
export interface State {
type: string;
name: string;
value: Record<string, SerializedObject> | null;
readonly: boolean;
doc: string | null;
};
}
/**
* Splits a full access path into its atomic parts, separating attribute names, numeric
@ -110,7 +110,7 @@ function getOrCreateItemInContainer(
function getContainerItemByKey(
container: Record<string, SerializedObject> | SerializedObject[],
key: string,
allowAppend: boolean = false,
allowAppend = false,
): SerializedObject {
const processedKey = parseSerializedKey(key);