Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ts): Suppress ts errors on Editor.tsx #11275

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,26 @@ export const Editor = forwardRef((props: EditorProps, ref) => {
const { manager, state, getContext } = useRemirror({
extensions: () => [
new BlockquoteExtension(),
new BoldExtension(),
new BulletListExtension(),
new BoldExtension({}),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even in the Remirror docs, they are not using an empty in constructor for these extensions: https://remirror.io/docs/extensions/bold-extension

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the link of an online editor, using the same version of packages. Showing the error:

https://stackblitz.com/edit/vitejs-vite-z3rg1l?file=src%2FEditor.tsx
(You need to wait till yarn install is complete, then the tsx error will start showing)


image

new BulletListExtension({}),
new CodeBlockExtension({ syntaxTheme: 'base16_ateliersulphurpool_light' }),
new CodeExtension(),
new DataHubMentionsExtension(),
new DropCursorExtension(),
new DataHubMentionsExtension({}),
new DropCursorExtension({}),
new HardBreakExtension(),
new HeadingExtension(),
new HistoryExtension(),
new HorizontalRuleExtension(),
new HeadingExtension({}),
new HistoryExtension({}),
new HorizontalRuleExtension({}),
new ImageExtension({ enableResizing: !readOnly }),
new ItalicExtension(),
new LinkExtension({ autoLink: true, defaultTarget: '_blank' }),
new ListItemExtension(),
new ListItemExtension({}),
new MarkdownExtension({ htmlSanitizer: DOMPurify.sanitize, htmlToMarkdown, markdownToHtml }),
new OrderedListExtension(),
new UnderlineExtension(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not do this for all of these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Errors did not come for others.

new StrikeExtension(),
new TableExtension({ resizable: false }),
...(readOnly ? [] : [new HistoryExtension()]),
...(readOnly ? [] : [new HistoryExtension({})]),
],
content,
stringHandler: 'markdown',
Expand Down
Loading