Skip to content

Commit

Permalink
Merge pull request #4452 from serlo/fix/restrict-editor-package-impor…
Browse files Browse the repository at this point in the history
…ts-within-editor

fix(editor): restrict @editor/package imports to avoid dep cycle
  • Loading branch information
hejtful authored Feb 4, 2025
2 parents f316994 + 1a7a7bf commit 244c7fb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/editor/src/___dev-demo/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { showToastNotice } from '@editor/editor-ui/show-toast-notice'
// eslint-disable-next-line no-restricted-imports
import { EditorPluginType, SerloEditor, SerloRenderer } from '@editor/package'
import { LearnerEventData } from '@editor/plugin/helpers/editor-learner-event'
import type { AnyEditorDocument } from '@editor/types/editor-plugins'
Expand Down
1 change: 1 addition & 0 deletions packages/editor/src/___dev-demo/standalone.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line no-restricted-imports
import { SerloEditor } from '@editor/package'
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/editor-integration/create-plugins.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { SupportedLanguage } from '@editor/package'
import type { EditorPlugin, StringStateType } from '@editor/plugin'
import { anchorPlugin } from '@editor/plugins/anchor'
import { articlePlugin } from '@editor/plugins/article'
Expand Down Expand Up @@ -41,6 +40,7 @@ import { textAreaExercisePlugin } from '@editor/plugins/text-area-exercise'
import { unsupportedPlugin } from '@editor/plugins/unsupported'
import { videoPlugin } from '@editor/plugins/video'
import { EditorPluginType } from '@editor/types/editor-plugin-type'
import type { SupportedLanguage } from '@editor/types/language-data'
import { TemplatePluginType } from '@editor/types/template-plugin-type'

import { createTestingImagePlugin } from './image-with-testing-config'
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module.exports = {
rules: {
// eslint
'no-duplicate-imports': 'error',
'no-restricted-imports': ['error', '@editor/package'],
'no-console': 'warn',
'no-warning-comments': 'warn',
eqeqeq: ['error', 'always'],
Expand Down

0 comments on commit 244c7fb

Please sign in to comment.