From 08aaa2b93376b1cfa92c7c62d5e564377f6d44ce Mon Sep 17 00:00:00 2001 From: Dirk Holtwick Date: Mon, 23 Sep 2024 10:41:22 +0200 Subject: [PATCH] fix: lint:fix --- src/html.ts | 8 ++++---- src/htmlparser.spec.ts | 2 +- src/index.browser.ts | 16 ++++++++-------- src/node.ts | 2 +- src/serialize-markdown.ts | 2 +- src/serialize-plaintext.ts | 4 ++-- src/serialize-safehtml.ts | 2 +- src/vcss.ts | 2 +- src/vdom.spec.tsx | 2 +- src/vdomparser.ts | 2 +- src/xml.ts | 2 +- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/html.ts b/src/html.ts index 1a754df..1002657 100644 --- a/src/html.ts +++ b/src/html.ts @@ -3,8 +3,8 @@ // 2. Attribute name '__' gets transformed to ':' for namespace emulation // 3. Emulate CDATA by element -import { hArgumentParser } from './h' import { escapeHTML } from './encoding' +import { hArgumentParser } from './h' import { hasOwn } from './utils' export const SELF_CLOSING_TAGS = [ @@ -43,9 +43,9 @@ export function markup( const hasChildren = !( (typeof children === 'string' && children === '') || (Array.isArray(children) - && (children.length === 0 - || (children.length === 1 && children[0] === ''))) - || children == null + && (children.length === 0 + || (children.length === 1 && children[0] === ''))) + || children == null ) const parts: string[] = [] diff --git a/src/htmlparser.spec.ts b/src/htmlparser.spec.ts index 0e998a5..e8fc4e5 100644 --- a/src/htmlparser.spec.ts +++ b/src/htmlparser.spec.ts @@ -1,5 +1,5 @@ import type { VHTMLDocument } from './vdom' -import { VTextNode, createHTMLDocument } from './vdom' +import { createHTMLDocument, VTextNode } from './vdom' import { parseHTML } from './vdomparser' describe('htmlparser', () => { diff --git a/src/index.browser.ts b/src/index.browser.ts index 18e1999..3fe1d61 100644 --- a/src/index.browser.ts +++ b/src/index.browser.ts @@ -1,13 +1,13 @@ -export * from './vdom' -export * from './h' -export * from './utils' - -export { vdom, parseHTML } from './vdomparser' export { escapeHTML, unescapeHTML } from './encoding' -export { tidyDOM } from './tidy' +export * from './h' export { CDATA, html } from './html' -export { xml } from './xml' + export { handleHTML } from './manipulate' export { serializeMarkdown } from './serialize-markdown' export { serializePlaintext } from './serialize-plaintext' -export { serializeSafeHTML, safeHTML } from './serialize-safehtml' +export { safeHTML, serializeSafeHTML } from './serialize-safehtml' +export { tidyDOM } from './tidy' +export * from './utils' +export * from './vdom' +export { parseHTML, vdom } from './vdomparser' +export { xml } from './xml' diff --git a/src/node.ts b/src/node.ts index b05075d..12ad195 100644 --- a/src/node.ts +++ b/src/node.ts @@ -1,5 +1,5 @@ -import { readFileSync, writeFileSync } from 'node:fs' import type { VHTMLDocument } from './vdom' +import { readFileSync, writeFileSync } from 'node:fs' import { parseHTML } from './vdomparser' /** Manipulate HTMl file directly on disk. Only writes back if there were significant changes. */ diff --git a/src/serialize-markdown.ts b/src/serialize-markdown.ts index 6beaeac..3ad76f8 100644 --- a/src/serialize-markdown.ts +++ b/src/serialize-markdown.ts @@ -1,5 +1,5 @@ import type { VElement } from './vdom' -import { VNode, isVElement } from './vdom' +import { isVElement, VNode } from './vdom' interface SerializeContext { level: number diff --git a/src/serialize-plaintext.ts b/src/serialize-plaintext.ts index be4ac6f..eebdb22 100644 --- a/src/serialize-plaintext.ts +++ b/src/serialize-plaintext.ts @@ -1,6 +1,6 @@ -import { SELECTOR_BLOCK_ELEMENTS } from './tidy' import type { VElement } from './vdom' -import { VNode, isVElement } from './vdom' +import { SELECTOR_BLOCK_ELEMENTS } from './tidy' +import { isVElement, VNode } from './vdom' interface SerializeContext { level: number diff --git a/src/serialize-safehtml.ts b/src/serialize-safehtml.ts index 44b030c..d5db607 100644 --- a/src/serialize-safehtml.ts +++ b/src/serialize-safehtml.ts @@ -1,5 +1,5 @@ import { escapeHTML } from './encoding' -import { VNode, isVElement } from './vdom' +import { isVElement, VNode } from './vdom' import { parseHTML } from './vdomparser' export const SELECTOR_BLOCK_ELEMENTS = 'p,h1,h2,h3,h4,h5,h6,blockquote,div,ul,ol,li,article,section,footer,nav,hr,form' diff --git a/src/vcss.ts b/src/vcss.ts index 51a5239..633babf 100644 --- a/src/vcss.ts +++ b/src/vcss.ts @@ -1,5 +1,5 @@ -import { parse } from 'css-what' import type { VElement } from './vdom' +import { parse } from 'css-what' function log(..._args: any) {} diff --git a/src/vdom.spec.tsx b/src/vdom.spec.tsx index b85946d..83e0802 100644 --- a/src/vdom.spec.tsx +++ b/src/vdom.spec.tsx @@ -1,5 +1,5 @@ // import Sizzle from './sizzle' -import { VDocument, VDocumentFragment, VElement, createHTMLDocument, h } from './vdom' +import { createHTMLDocument, h, VDocument, VDocumentFragment, VElement } from './vdom' import { parseHTML } from './vdomparser' import { xml } from './xml' diff --git a/src/vdomparser.ts b/src/vdomparser.ts index 081cba6..d1ad118 100644 --- a/src/vdomparser.ts +++ b/src/vdomparser.ts @@ -4,7 +4,7 @@ import { unescapeHTML } from './encoding' import { SELF_CLOSING_TAGS } from './html' import { HtmlParser } from './htmlparser' import { hasOwn } from './utils' -import { VDocType, VDocumentFragment, VElement, VHTMLDocument, VNode, VTextNode, document } from './vdom' +import { document, VDocType, VDocumentFragment, VElement, VHTMLDocument, VNode, VTextNode } from './vdom' // Makes sure we operate on VNodes export function vdom(obj: VNode | Buffer | string | null = null): VNode { diff --git a/src/xml.ts b/src/xml.ts index 2a80438..a93024a 100644 --- a/src/xml.ts +++ b/src/xml.ts @@ -1,6 +1,6 @@ -import './jsx-runtime' import { hArgumentParser } from './h' import { markup } from './html' +import './jsx-runtime' export function xml(itag: string, iattrs?: object, ...ichildren: any[]) { const { tag, attrs, children } = hArgumentParser(itag, iattrs, ichildren)