chore: lint fix

This commit is contained in:
Michael Zetterberg
2024-04-22 06:58:50 +02:00
parent abdc48f57f
commit 14e93eba7c
82 changed files with 282 additions and 160 deletions

View File

@@ -1,20 +1,20 @@
import Image from "@/components/Image"
import Link from "next/link"
import { EmbedEnum } from "@/types/requests/utils/embeds"
import { RTEItemTypeEnum, RTETypeEnum } from "@/types/rte/enums"
import { RTEMarkType } from "@/types/rte/node"
import Image from "@/components/Image"
import styles from "./jsontohtml.module.css"
import type { Attributes } from "@/types/rte/attrs"
import type { EmbedByUid } from "@/types/components/jsontohtml"
import { EmbedEnum } from "@/types/requests/utils/embeds"
import type { Attributes } from "@/types/rte/attrs"
import { RTEItemTypeEnum, RTETypeEnum } from "@/types/rte/enums"
import type {
RTENext,
RTEDefaultNode,
RTENext,
RTENode,
RTERegularNode,
} from "@/types/rte/node"
import { RTEMarkType } from "@/types/rte/node"
import type { RenderOptions } from "@/types/rte/option"
function extractPossibleAttributes(attrs: Attributes) {
@@ -263,7 +263,9 @@ export const renderOptions: RenderOptions = {
}
} else {
const props = extractPossibleAttributes(node.attrs)
const href = node.attrs?.locale ? `/${node.attrs.locale}${node.attrs.href}` : node.attrs.href
const href = node.attrs?.locale
? `/${node.attrs.locale}${node.attrs.href}`
: node.attrs.href
return (
<Link {...props} href={href} key={node.uid}>
{next(node.children, embeds, fullRenderOptions)}

View File

@@ -1,17 +1,16 @@
import { renderOptions } from "./renderOptions"
import { RTEMarkType, RTERenderMark } from "@/types/rte/node"
import { RTETypeEnum } from "@/types/rte/enums"
import type { EmbedByUid } from "@/types/components/jsontohtml"
import type { Embeds } from "@/types/requests/embeds"
import type { Node } from "@/types/requests/utils/edges"
import type { RenderOptions } from "@/types/rte/option"
import { RTETypeEnum } from "@/types/rte/enums"
import type {
RTENode,
RTETextNode,
RTERenderOptionComponent,
RTETextNode,
} from "@/types/rte/node"
import type { Embeds } from "@/types/requests/embeds"
import { RTEMarkType, RTERenderMark } from "@/types/rte/node"
import type { RenderOptions } from "@/types/rte/option"
export function groupEmbedsByUid(embedsArray: Node<Embeds>[]) {
const embedsByUid = embedsArray.reduce<EmbedByUid>((acc, embed) => {