Skip to content

Commit

Permalink
Require file extensions for imports and exports (ueberdosis#4001)
Browse files Browse the repository at this point in the history
* Require .js endings

* add extension alias for cypress to resolve ts files with js endings
  • Loading branch information
benasher44 committed Jun 30, 2023
1 parent 917f8be commit 0cb8c10
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/Editor.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Editor as CoreEditor } from '@tiptap/core'
import React from 'react'

import { EditorContentProps, EditorContentState } from './EditorContent'
import { ReactRenderer } from './ReactRenderer'
import { EditorContentProps, EditorContentState } from './EditorContent.js'
import { ReactRenderer } from './ReactRenderer.js'

type ContentComponent = React.Component<EditorContentProps, EditorContentState> & {
setRenderer(id: string, renderer: ReactRenderer): void;
Expand Down
4 changes: 2 additions & 2 deletions src/EditorContent.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { HTMLProps } from 'react'
import ReactDOM, { flushSync } from 'react-dom'

import { Editor } from './Editor'
import { ReactRenderer } from './ReactRenderer'
import { Editor } from './Editor.js'
import { ReactRenderer } from './ReactRenderer.js'

const Portals: React.FC<{ renderers: Record<string, ReactRenderer> }> = ({ renderers }) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/NodeViewContent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import { useReactNodeView } from './useReactNodeView'
import { useReactNodeView } from './useReactNodeView.js'

export interface NodeViewContentProps {
[key: string]: any,
Expand Down
2 changes: 1 addition & 1 deletion src/NodeViewWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import { useReactNodeView } from './useReactNodeView'
import { useReactNodeView } from './useReactNodeView.js'

export interface NodeViewWrapperProps {
[key: string]: any,
Expand Down
6 changes: 3 additions & 3 deletions src/ReactNodeViewRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { Node as ProseMirrorNode } from '@tiptap/pm/model'
import { Decoration, NodeView as ProseMirrorNodeView } from '@tiptap/pm/view'
import React from 'react'

import { Editor } from './Editor'
import { ReactRenderer } from './ReactRenderer'
import { ReactNodeViewContext, ReactNodeViewContextProps } from './useReactNodeView'
import { Editor } from './Editor.js'
import { ReactRenderer } from './ReactRenderer.js'
import { ReactNodeViewContext, ReactNodeViewContextProps } from './useReactNodeView.js'

export interface ReactNodeViewRendererOptions extends NodeViewRendererOptions {
update:
Expand Down
2 changes: 1 addition & 1 deletion src/ReactRenderer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Editor } from '@tiptap/core'
import React from 'react'

import { Editor as ExtendedEditor } from './Editor'
import { Editor as ExtendedEditor } from './Editor.js'

function isClassComponent(Component: any) {
return !!(
Expand Down
18 changes: 9 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export * from './BubbleMenu'
export { Editor } from './Editor'
export * from './EditorContent'
export * from './FloatingMenu'
export * from './NodeViewContent'
export * from './NodeViewWrapper'
export * from './ReactNodeViewRenderer'
export * from './ReactRenderer'
export * from './useEditor'
export * from './BubbleMenu.js'
export { Editor } from './Editor.js'
export * from './EditorContent.js'
export * from './FloatingMenu.js'
export * from './NodeViewContent.js'
export * from './NodeViewWrapper.js'
export * from './ReactNodeViewRenderer.js'
export * from './ReactRenderer.js'
export * from './useEditor.js'
export * from '@tiptap/core'
2 changes: 1 addition & 1 deletion src/useEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useState,
} from 'react'

import { Editor } from './Editor'
import { Editor } from './Editor.js'

function useForceUpdate() {
const [, setValue] = useState(0)
Expand Down

0 comments on commit 0cb8c10

Please sign in to comment.