-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add ELSint rule to check inter-packages imports #8581
Add ELSint rule to check inter-packages imports #8581
Comments
|
TODO: Update remaining incorrect imports (also in CF and internal). |
In the -import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
-import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
+import { Plugin } from 'ckeditor5/src/core';
-import ViewDocumentFragment from '@ckeditor/ckeditor5-engine/src/view/documentfragment';
-import ViewDowncastWriter from '@ckeditor/ckeditor5-engine/src/view/downcastwriter';
-import first from '@ckeditor/ckeditor5-utils/src/first';
+import { first } from 'ckeditor5/src/utils';
import {
+ UpcastWriter,
needsPlaceholder,
showPlaceholder,
hidePlaceholder,
enablePlaceholder
-} from '@ckeditor/ckeditor5-engine/src/view/placeholder';
+} from 'ckeditor5/src/engine'; @@ -44,7 +42,7 @@ export default class Title extends Plugin {
* @inheritDoc
*/
static get requires() {
- return [ Paragraph ];
+ return [ 'Paragraph' ];
} /**
@@ -149,10 +147,11 @@ export default class Title extends Plugin {
const data = editor.data;
const model = editor.model;
const root = editor.model.document.getRoot();
- const viewWriter = new ViewDowncastWriter( editor.editing.view.document );
+ const view = editor.editing.view;
+ const viewWriter = view.change( viewWriter => viewWriter );
const rootRange = model.createRangeIn( root );
- const viewDocumentFragment = new ViewDocumentFragment( editor.editing.view.document );
+ const viewDocumentFragment = new UpcastWriter( view.document ).createDocumentFragment();
data.downcastDispatcher.conversionApi.options = options; Are we fine with the changes above? |
As for the |
@pomek pointed out that this will mean using two different writers in one piece of code. I thought at first that these are two different methods. This piece of code is copied directly from |
Feature: Added a rule that disallows direct imports of packages that belong to CKEditor 5 DLL. Closes ckeditor/ckeditor5#8581.
Internal: Updated import paths. See #8581.
📝 Provide a description of the new feature
Follow-up for the #8395. We're going to change how we import things from other packages.
This ESLint rule should check if the imports from other packages are pointing to the package entry file instead of direct import.
In other words, depending on how the #8578 is resolved the imports should point to entry file:
The wrong import would be:
If you'd like to see this feature implemented, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: