Skip to content

Commit

Permalink
refactor(editor): clean up and organize imports across extensions
Browse files Browse the repository at this point in the history
Update the import statements in the editor's extensions to remove redundant and disorganized imports. This includes:
- Removing unnecessary imports.
- Changing the import source for consistent usage.
- Organizing imports to improve readability.
- Updating TypeScript comments for better compliance.
  • Loading branch information
phodal committed Nov 4, 2024
1 parent c34f3a2 commit e69df8e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
9 changes: 4 additions & 5 deletions web/core/lib/editor/extensions/advice/advice-extension.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This code based on https://github.com/sereneinserenade/tiptap-comment-extension which is licensed under MIT License
import { Mark, mergeAttributes, Range } from "@tiptap/core";
import { Mark as PMMark } from "@tiptap/pm/model";
import { CommandProps } from "@tiptap/react";
import { CommandProps, Mark, mergeAttributes, Range } from "@tiptap/react";
import { Advice } from "./advice";

declare module "@tiptap/core" {
Expand Down Expand Up @@ -56,7 +55,6 @@ export const AdviceExtension = Mark.create<CommentOptions, CommentStorage>({
};
},

// @ts-ignore
parseHTML() {
return [
{
Expand All @@ -69,7 +67,7 @@ export const AdviceExtension = Mark.create<CommentOptions, CommentStorage>({
},

renderHTML({ HTMLAttributes }: {
HTMLAttributes: Record<string, any>
HTMLAttributes: Record<string, unknown>
}) {
return ["span", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0,];
},
Expand All @@ -96,7 +94,8 @@ export const AdviceExtension = Mark.create<CommentOptions, CommentStorage>({
};
},

// @ts-ignore
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
addCommands() {
return {
setAdviceCommand: (comment: Advice) => ({ commands }: CommandProps) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { findChildren, Node, NodeViewWrapper, ReactNodeViewRenderer } from '@tiptap/react';
import { Editor } from "@tiptap/core";
import React, { useEffect, useRef } from "react";
import { NodeViewWrapper, ReactNodeViewRenderer } from '@tiptap/react';
import { Node, Editor } from '@tiptap/core';
import React, { useEffect, useRef } from 'react';
import { KeyboardIcon } from "@radix-ui/react-icons";

declare module '@tiptap/core' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
* origin: https://github.com/ueberdosis/tiptap/blob/develop/packages/extension-code-block/src/code-block.ts
*/
import {
Node,
RawCommands,
ReactNodeViewRenderer,
} from "@tiptap/react";
import { Node } from "@tiptap/core";

import QuickBoxViewWrapper from "./quick-box-view-wrapper";

Expand Down
1 change: 1 addition & 0 deletions web/core/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default defineConfig({
externalizeDeps(),
dts({
outDir: './dist-types',
rollupTypes: true
}),
libInjectCss(),
react(),
Expand Down

0 comments on commit e69df8e

Please sign in to comment.