From 4c0048f6399389d33bd69f4bb6f5ae2e5abf5449 Mon Sep 17 00:00:00 2001 From: Mirone Date: Wed, 4 Sep 2024 05:14:19 +0800 Subject: [PATCH] chore: fix --- e2e/src/lit/components/Hashes.ts | 2 +- e2e/src/react/components/Hashes.tsx | 2 +- eslint.config.mjs | 11 ++++++----- examples/lit/src/components/Hashes.ts | 2 +- examples/react/components/Hashes.tsx | 2 +- packages/lit/src/nodeView/LitNodeView.ts | 3 ++- packages/svelte/src/nodeView/SvelteNodeView.ts | 3 ++- packages/vue/src/nodeView/VueNodeView.tsx | 3 ++- 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/e2e/src/lit/components/Hashes.ts b/e2e/src/lit/components/Hashes.ts index a87d35d..cfa51a8 100644 --- a/e2e/src/lit/components/Hashes.ts +++ b/e2e/src/lit/components/Hashes.ts @@ -9,7 +9,7 @@ export class Hashes extends ShallowLitElement { override render() { const spec = this.widgetViewContext.value?.spec const level = spec?.level ?? 0 - const hashes = Array(level).fill('#').join('') + const hashes = new Array(level).fill('#').join('') return html`${hashes}` } } diff --git a/e2e/src/react/components/Hashes.tsx b/e2e/src/react/components/Hashes.tsx index 9e24e1f..946da36 100644 --- a/e2e/src/react/components/Hashes.tsx +++ b/e2e/src/react/components/Hashes.tsx @@ -3,7 +3,7 @@ import { useWidgetViewContext } from '@prosemirror-adapter/react' export function Hashes() { const { spec } = useWidgetViewContext() const level = spec?.level - const hashes = Array(level || 0).fill('#').join('') + const hashes = new Array(level || 0).fill('#').join('') return {hashes} } diff --git a/eslint.config.mjs b/eslint.config.mjs index 4b1be13..cffee3e 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -7,17 +7,16 @@ export default antfu( { stylistic: true, markdown: false, - typescript: { - tsconfigPath: 'tsconfig.json', - }, ignores: [ '.idea', '**/lib', '**/.svelte-kit', 'CHANGELOG.md', + 'vite.config.ts', + '**/shim.d.ts', ], - overrides: { - typescript: { + typescript: { + overrides: { 'ts/no-unsafe-assignment': 'off', 'ts/no-unsafe-member-access': 'off', 'ts/no-unsafe-argument': 'off', @@ -25,6 +24,8 @@ export default antfu( 'ts/no-unsafe-return': 'off', 'ts/unbound-method': 'off', 'ts/ban-types': 'off', + 'ts/strict-boolean-expressions': 'off', + 'unicorn/no-new-array': 'off', }, }, }, diff --git a/examples/lit/src/components/Hashes.ts b/examples/lit/src/components/Hashes.ts index a87d35d..cfa51a8 100644 --- a/examples/lit/src/components/Hashes.ts +++ b/examples/lit/src/components/Hashes.ts @@ -9,7 +9,7 @@ export class Hashes extends ShallowLitElement { override render() { const spec = this.widgetViewContext.value?.spec const level = spec?.level ?? 0 - const hashes = Array(level).fill('#').join('') + const hashes = new Array(level).fill('#').join('') return html`${hashes}` } } diff --git a/examples/react/components/Hashes.tsx b/examples/react/components/Hashes.tsx index 9e24e1f..946da36 100644 --- a/examples/react/components/Hashes.tsx +++ b/examples/react/components/Hashes.tsx @@ -3,7 +3,7 @@ import { useWidgetViewContext } from '@prosemirror-adapter/react' export function Hashes() { const { spec } = useWidgetViewContext() const level = spec?.level - const hashes = Array(level || 0).fill('#').join('') + const hashes = new Array(level || 0).fill('#').join('') return {hashes} } diff --git a/packages/lit/src/nodeView/LitNodeView.ts b/packages/lit/src/nodeView/LitNodeView.ts index a40e08b..bc348d0 100644 --- a/packages/lit/src/nodeView/LitNodeView.ts +++ b/packages/lit/src/nodeView/LitNodeView.ts @@ -60,8 +60,9 @@ export class LitNodeView extends CoreNodeView implements L && element instanceof HTMLElement && this.contentDOM && element.firstChild !== this.contentDOM - ) + ) { element.appendChild(this.contentDOM) + } }, view: this.view, getPos: this.getPos, diff --git a/packages/svelte/src/nodeView/SvelteNodeView.ts b/packages/svelte/src/nodeView/SvelteNodeView.ts index efbffa0..69b50c2 100644 --- a/packages/svelte/src/nodeView/SvelteNodeView.ts +++ b/packages/svelte/src/nodeView/SvelteNodeView.ts @@ -17,8 +17,9 @@ export class SvelteNodeView extends CoreNodeView implem && element instanceof HTMLElement && this.contentDOM && element.firstChild !== this.contentDOM - ) + ) { element.appendChild(this.contentDOM) + } }, view: this.view, getPos: this.getPos, diff --git a/packages/vue/src/nodeView/VueNodeView.tsx b/packages/vue/src/nodeView/VueNodeView.tsx index a12e5f8..9bd6044 100644 --- a/packages/vue/src/nodeView/VueNodeView.tsx +++ b/packages/vue/src/nodeView/VueNodeView.tsx @@ -17,8 +17,9 @@ export class VueNodeView extends CoreNodeView implements V && element instanceof HTMLElement && this.contentDOM && element.firstChild !== this.contentDOM - ) + ) { element.appendChild(this.contentDOM) + } }, view: this.view, getPos: this.getPos,