Przeglądaj źródła

Fix ESLint errors related to new CKEditorError check.

Maciej Gołaszewski 5 lat temu
rodzic
commit
d792e320aa
32 zmienionych plików z 129 dodań i 163 usunięć
  1. 5 0
      packages/ckeditor5-ckfinder/src/ckfindercommand.js
  2. 2 4
      packages/ckeditor5-core/src/context.js
  3. 2 4
      packages/ckeditor5-core/tests/_utils/classictesteditor.js
  4. 1 0
      packages/ckeditor5-core/tests/editor/editor.js
  5. 4 8
      packages/ckeditor5-editor-balloon/src/ballooneditor.js
  6. 2 4
      packages/ckeditor5-editor-classic/src/classiceditor.js
  7. 4 6
      packages/ckeditor5-editor-decoupled/src/decouplededitor.js
  8. 4 6
      packages/ckeditor5-editor-inline/src/inlineeditor.js
  9. 5 13
      packages/ckeditor5-engine/src/model/document.js
  10. 2 5
      packages/ckeditor5-engine/src/model/liveposition.js
  11. 5 0
      packages/ckeditor5-engine/src/model/markercollection.js
  12. 6 0
      packages/ckeditor5-engine/src/model/node.js
  13. 3 6
      packages/ckeditor5-engine/src/model/nodelist.js
  14. 2 6
      packages/ckeditor5-engine/src/model/operation/rootattributeoperation.js
  15. 17 20
      packages/ckeditor5-engine/src/model/position.js
  16. 6 15
      packages/ckeditor5-engine/src/model/selection.js
  17. 6 5
      packages/ckeditor5-engine/src/model/treewalker.js
  18. 14 18
      packages/ckeditor5-engine/src/model/writer.js
  19. 2 5
      packages/ckeditor5-engine/src/view/position.js
  20. 1 1
      packages/ckeditor5-engine/src/view/renderer.js
  21. 5 11
      packages/ckeditor5-engine/src/view/selection.js
  22. 6 5
      packages/ckeditor5-engine/src/view/treewalker.js
  23. 2 0
      packages/ckeditor5-engine/tests/model/model.js
  24. 1 0
      packages/ckeditor5-engine/tests/view/view/view.js
  25. 2 5
      packages/ckeditor5-ui/src/view.js
  26. 11 4
      packages/ckeditor5-upload/src/filerepository.js
  27. 1 1
      packages/ckeditor5-utils/src/collection.js
  28. 1 1
      packages/ckeditor5-utils/src/focustracker.js
  29. 2 5
      packages/ckeditor5-utils/src/keyboard.js
  30. 2 5
      packages/ckeditor5-utils/src/observablemixin.js
  31. 2 0
      packages/ckeditor5-utils/tests/ckeditorerror.js
  32. 1 0
      packages/ckeditor5-utils/tests/emittermixin.js

+ 5 - 0
packages/ckeditor5-ckfinder/src/ckfindercommand.js

@@ -60,6 +60,11 @@ export default class CKFinderCommand extends Command {
 		const openerMethod = this.editor.config.get( 'ckfinder.openerMethod' ) || 'modal';
 
 		if ( openerMethod != 'popup' && openerMethod != 'modal' ) {
+			/**
+			 * The `ckfinder.openerMethod` must be one of: "popup" or "modal".
+			 *
+			 * @error ckfinder-unknown-openermethod
+			 */
 			throw new CKEditorError( 'ckfinder-unknown-openermethod', editor );
 		}
 

+ 2 - 4
packages/ckeditor5-core/src/context.js

@@ -177,11 +177,9 @@ export default class Context {
 			/**
 			 * Cannot add multiple editors to the context which is created by the editor.
 			 *
-			 * @error context-addEditor-private-context
+			 * @error context-addeditor-private-context
 			 */
-			throw new CKEditorError(
-				'context-addeditor-private-context'
-			);
+			throw new CKEditorError( 'context-addeditor-private-context' );
 		}
 
 		this.editors.add( editor );

+ 2 - 4
packages/ckeditor5-core/tests/_utils/classictesteditor.js

@@ -77,10 +77,8 @@ export default class ClassicTestEditor extends Editor {
 					.then( () => {
 						if ( !isElement( sourceElementOrData ) && config.initialData ) {
 							// Documented in core/editor/editorconfig.jsdoc.
-							throw new CKEditorError(
-								'editor-create-initial-data',
-								null
-							);
+							// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
+							throw new CKEditorError( 'editor-create-initial-data', null );
 						}
 
 						editor.data.init( config.initialData || getInitialData( sourceElementOrData ) );

+ 1 - 0
packages/ckeditor5-core/tests/editor/editor.js

@@ -543,6 +543,7 @@ describe( 'Editor', () => {
 					this.isEnabled = true;
 				}
 				execute() {
+					// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
 					throw new CKEditorError( 'foo', editor );
 				}
 			}

+ 4 - 8
packages/ckeditor5-editor-balloon/src/ballooneditor.js

@@ -203,10 +203,8 @@ export default class BalloonEditor extends Editor {
 
 			if ( isHTMLElement && sourceElementOrData.tagName === 'TEXTAREA' ) {
 				// Documented in core/editor/editor.js
-				throw new CKEditorError(
-					'editor-wrong-element',
-					null
-				);
+				// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
+				throw new CKEditorError( 'editor-wrong-element', null );
 			}
 
 			const editor = new this( sourceElementOrData, config );
@@ -219,10 +217,8 @@ export default class BalloonEditor extends Editor {
 					.then( () => {
 						if ( !isHTMLElement && config.initialData ) {
 							// Documented in core/editor/editorconfig.jdoc.
-							throw new CKEditorError(
-								'editor-create-initial-data',
-								null
-							);
+							// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
+							throw new CKEditorError( 'editor-create-initial-data', null );
 						}
 
 						const initialData = config.initialData || getInitialData( sourceElementOrData );

+ 2 - 4
packages/ckeditor5-editor-classic/src/classiceditor.js

@@ -200,10 +200,8 @@ export default class ClassicEditor extends Editor {
 					.then( () => {
 						if ( !isElement( sourceElementOrData ) && config.initialData ) {
 							// Documented in core/editor/editorconfig.jdoc.
-							throw new CKEditorError(
-								'editor-create-initial-data',
-								null
-							);
+							// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
+							throw new CKEditorError( 'editor-create-initial-data', null );
 						}
 
 						const initialData = config.initialData || getInitialData( sourceElementOrData );

+ 4 - 6
packages/ckeditor5-editor-decoupled/src/decouplededitor.js

@@ -226,8 +226,8 @@ export default class DecoupledEditor extends Editor {
 
 			if ( isHTMLElement && sourceElementOrData.tagName === 'TEXTAREA' ) {
 				// Documented in core/editor/editor.js
-				throw new CKEditorError(
-					'editor-wrong-element', null );
+				// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
+				throw new CKEditorError( 'editor-wrong-element', null );
 			}
 
 			const editor = new this( sourceElementOrData, config );
@@ -240,10 +240,8 @@ export default class DecoupledEditor extends Editor {
 					.then( () => {
 						if ( !isHTMLElement && config.initialData ) {
 							// Documented in core/editor/editorconfig.jdoc.
-							throw new CKEditorError(
-								'editor-create-initial-data',
-								null
-							);
+							// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
+							throw new CKEditorError( 'editor-create-initial-data', null );
 						}
 
 						const initialData = config.initialData || getInitialData( sourceElementOrData );

+ 4 - 6
packages/ckeditor5-editor-inline/src/inlineeditor.js

@@ -199,8 +199,8 @@ export default class InlineEditor extends Editor {
 
 			if ( isHTMLElement && sourceElementOrData.tagName === 'TEXTAREA' ) {
 				// Documented in core/editor/editor.js
-				throw new CKEditorError(
-					'editor-wrong-element', null );
+				// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
+				throw new CKEditorError( 'editor-wrong-element', null );
 			}
 
 			const editor = new this( sourceElementOrData, config );
@@ -213,10 +213,8 @@ export default class InlineEditor extends Editor {
 					.then( () => {
 						if ( !isHTMLElement && config.initialData ) {
 							// Documented in core/editor/editorconfig.jdoc.
-							throw new CKEditorError(
-								'editor-create-initial-data',
-								null
-							);
+							// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
+							throw new CKEditorError( 'editor-create-initial-data', null );
 						}
 
 						const initialData = config.initialData || getInitialData( sourceElementOrData );

+ 5 - 13
packages/ckeditor5-engine/src/model/document.js

@@ -57,7 +57,7 @@ export default class Document {
 		 * operations are applied on a proper document version.
 		 *
 		 * If the {@link module:engine/model/operation/operation~Operation#baseVersion base version} does not match the document version,
-		 * a {@link module:utils/ckeditorerror~CKEditorError model-document-applyOperation-wrong-version} error is thrown.
+		 * a {@link module:utils/ckeditorerror~CKEditorError model-document-applyoperation-wrong-version} error is thrown.
 		 *
 		 * @type {Number}
 		 */
@@ -123,14 +123,10 @@ export default class Document {
 				/**
 				 * Only operations with matching versions can be applied.
 				 *
-				 * @error document-applyOperation-wrong-version
+				 * @error model-document-applyoperation-wrong-version
 				 * @param {module:engine/model/operation/operation~Operation} operation
 				 */
-				throw new CKEditorError(
-					'model-document-applyoperation-wrong-version',
-					this,
-					{ operation }
-				);
+				throw new CKEditorError( 'model-document-applyoperation-wrong-version', this, { operation } );
 			}
 		}, { priority: 'highest' } );
 
@@ -197,15 +193,11 @@ export default class Document {
 			/**
 			 * A root with the specified name already exists.
 			 *
-			 * @error model-document-createRoot-name-exists
+			 * @error model-document-createroot-name-exists
 			 * @param {module:engine/model/document~Document} doc
 			 * @param {String} name
 			 */
-			throw new CKEditorError(
-				'model-document-createroot-name-exists',
-				this,
-				{ name: rootName }
-			);
+			throw new CKEditorError( 'model-document-createroot-name-exists', this, { name: rootName } );
 		}
 
 		const root = new RootElement( this, elementName, rootName );

+ 2 - 5
packages/ckeditor5-engine/src/model/liveposition.js

@@ -43,12 +43,9 @@ export default class LivePosition extends Position {
 			/**
 			 * LivePosition's root has to be an instance of RootElement.
 			 *
-			 * @error liveposition-root-not-rootelement
+			 * @error model-liveposition-root-not-rootelement
 			 */
-			throw new CKEditorError(
-				'model-liveposition-root-not-rootelement',
-				root
-			);
+			throw new CKEditorError( 'model-liveposition-root-not-rootelement', root );
 		}
 
 		bindWithDocument.call( this );

+ 5 - 0
packages/ckeditor5-engine/src/model/markercollection.js

@@ -177,6 +177,11 @@ export default class MarkerCollection {
 		const marker = this._markers.get( markerName );
 
 		if ( !marker ) {
+			/**
+			 * Marker with provided name does not exists.
+			 *
+			 * @error markercollection-refresh-marker-not-exists
+			 */
 			throw new CKEditorError( 'markercollection-refresh-marker-not-exists', this );
 		}
 

+ 6 - 0
packages/ckeditor5-engine/src/model/node.js

@@ -499,3 +499,9 @@ export default class Node {
 		this._attrs.clear();
 	}
 }
+
+/**
+ * The node's parent does not contain this node.
+ *
+ * @error model-node-not-found-in-parent
+ */

+ 3 - 6
packages/ckeditor5-engine/src/model/nodelist.js

@@ -122,7 +122,7 @@ export default class NodeList {
 			/**
 			 * Given index cannot be found in the node list.
 			 *
-			 * @error nodelist-index-out-of-bounds
+			 * @error model-nodelist-index-out-of-bounds
 			 */
 			throw new CKEditorError( 'model-nodelist-index-out-of-bounds', this );
 		}
@@ -184,12 +184,9 @@ export default class NodeList {
 				/**
 				 * Trying to insert an object which is not a Node instance.
 				 *
-				 * @error nodelist-insertNodes-not-node
+				 * @error model-nodelist-insertnodes-not-node
 				 */
-				throw new CKEditorError(
-					'model-nodelist-insertnodes-not-node',
-					this
-				);
+				throw new CKEditorError( 'model-nodelist-insertnodes-not-node', this );
 			}
 		}
 

+ 2 - 6
packages/ckeditor5-engine/src/model/operation/rootattributeoperation.js

@@ -194,14 +194,10 @@ export default class RootAttributeOperation extends Operation {
 			/**
 			 * Cannot create RootAttributeOperation for document. Root with specified name does not exist.
 			 *
-			 * @error rootattributeoperation-fromjson-no-root
+			 * @error rootattribute-operation-fromjson-no-root
 			 * @param {String} rootName
 			 */
-			throw new CKEditorError(
-				'rootattribute-operation-fromjson-no-root',
-				this,
-				{ rootName: json.root }
-			);
+			throw new CKEditorError( 'rootattribute-operation-fromjson-no-root', this, { rootName: json.root } );
 		}
 
 		return new RootAttributeOperation( document.getRoot( json.root ), json.key, json.oldValue, json.newValue, json.baseVersion );

+ 17 - 20
packages/ckeditor5-engine/src/model/position.js

@@ -169,26 +169,26 @@ export default class Position {
 			parent = parent.getChild( parent.offsetToIndex( this.path[ i ] ) );
 
 			if ( !parent ) {
+				/**
+				 * The position's path is incorrect. This means that a position does not point to
+				 * a correct place in the tree and hence, some of its methods and getters cannot work correctly.
+				 *
+				 * **Note**: Unlike DOM and view positions, in the model, the
+				 * {@link module:engine/model/position~Position#parent position's parent} is always an element or a document fragment.
+				 * The last offset in the {@link module:engine/model/position~Position#path position's path} is the point in this element
+				 * where this position points.
+				 *
+				 * Read more about model positions and offsets in
+				 * the {@glink framework/guides/architecture/editing-engine#indexes-and-offsets Editing engine architecture guide}.
+				 *
+				 * @error model-position-path-incorrect
+				 * @param {module:engine/model/position~Position} position The incorrect position.
+				 */
 				throw new CKEditorError( 'model-position-path-incorrect', this, { position: this } );
 			}
 		}
 
 		if ( parent.is( '$text' ) ) {
-			/**
-			 * The position's path is incorrect. This means that a position does not point to
-			 * a correct place in the tree and hence, some of its methods and getters cannot work correctly.
-			 *
-			 * **Note**: Unlike DOM and view positions, in the model, the
-			 * {@link module:engine/model/position~Position#parent position's parent} is always an element or a document fragment.
-			 * The last offset in the {@link module:engine/model/position~Position#path position's path} is the point in this element where
-			 * this position points.
-			 *
-			 * Read more about model positions and offsets in
-			 * the {@glink framework/guides/architecture/editing-engine#indexes-and-offsets Editing engine architecture guide}.
-			 *
-			 * @error position-incorrect-path
-			 * @param {module:engine/model/position~Position} position The incorrect position.
-			 */
 			throw new CKEditorError( 'model-position-path-incorrect', this, { position: this } );
 		}
 
@@ -923,12 +923,9 @@ export default class Position {
 				 * {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}
 				 * requires the offset to be specified when the first parameter is a model item.
 				 *
-				 * @error model-createPositionAt-offset-required
+				 * @error model-createpositionat-offset-required
 				 */
-				throw new CKEditorError(
-					'model-createpositionat-offset-required',
-					[ this, itemOrPosition ]
-				);
+				throw new CKEditorError( 'model-createpositionat-offset-required', [ this, itemOrPosition ] );
 			}
 
 			if ( !node.is( 'element' ) && !node.is( 'documentFragment' ) ) {

+ 6 - 15
packages/ckeditor5-engine/src/model/selection.js

@@ -390,12 +390,9 @@ export default class Selection {
 				/**
 				 * selection.setTo requires the second parameter when the first parameter is a node.
 				 *
-				 * @error model-selection-setTo-required-second-parameter
+				 * @error model-selection-setto-required-second-parameter
 				 */
-				throw new CKEditorError(
-					'model-selection-setto-required-second-parameter',
-					[ this, selectable ]
-				);
+				throw new CKEditorError( 'model-selection-setto-required-second-parameter', [ this, selectable ] );
 			}
 
 			this._setRanges( [ range ], backward );
@@ -413,12 +410,9 @@ export default class Selection {
 			 * * View nodes were passed instead of model nodes.
 			 * * `null`/`undefined` was passed.
 			 *
-			 * @error model-selection-setTo-not-selectable
+			 * @error model-selection-setto-not-selectable
 			 */
-			throw new CKEditorError(
-				'model-selection-setto-not-selectable',
-				[ this, selectable ]
-			);
+			throw new CKEditorError( 'model-selection-setto-not-selectable', [ this, selectable ] );
 		}
 	}
 
@@ -493,12 +487,9 @@ export default class Selection {
 			/**
 			 * Cannot set selection focus if there are no ranges in selection.
 			 *
-			 * @error model-selection-setFocus-no-ranges
+			 * @error model-selection-setfocus-no-ranges
 			 */
-			throw new CKEditorError(
-				'model-selection-setfocus-no-ranges',
-				[ this, itemOrPosition ]
-			);
+			throw new CKEditorError( 'model-selection-setfocus-no-ranges', [ this, itemOrPosition ] );
 		}
 
 		const newFocus = Position._createAt( itemOrPosition, offset );

+ 6 - 5
packages/ckeditor5-engine/src/model/treewalker.js

@@ -56,11 +56,12 @@ export default class TreeWalker {
 		const direction = options.direction || 'forward';
 
 		if ( direction != 'forward' && direction != 'backward' ) {
-			throw new CKEditorError(
-				'model-tree-walker-unknown-direction',
-				options,
-				{ direction }
-			);
+			/**
+			 * Only `backward` and `forward` direction allowed.
+			 *
+			 * @error model-tree-walker-unknown-direction
+			 */
+			throw new CKEditorError( 'model-tree-walker-unknown-direction', options, { direction } );
 		}
 
 		/**

+ 14 - 18
packages/ckeditor5-engine/src/model/writer.js

@@ -768,6 +768,11 @@ export default class Writer {
 		}
 
 		if ( !position.parent.getAncestors( { includeSelf: true } ).includes( limitElement ) ) {
+			/**
+			 * Limit element is not a position ancestor.
+			 *
+			 * @error writer-split-invalid-limit-element
+			 */
 			throw new CKEditorError( 'writer-split-invalid-limit-element', this );
 		}
 
@@ -917,12 +922,9 @@ export default class Writer {
 			/**
 			 * The `options.usingOperation` parameter is required when adding a new marker.
 			 *
-			 * @error writer-addMarker-no-usingOperation
+			 * @error writer-addmarker-no-usingoperation
 			 */
-			throw new CKEditorError(
-				'writer-addmarker-no-usingoperation',
-				this
-			);
+			throw new CKEditorError( 'writer-addmarker-no-usingoperation', this );
 		}
 
 		const usingOperation = options.usingOperation;
@@ -933,7 +935,7 @@ export default class Writer {
 			/**
 			 * Marker with provided name already exists.
 			 *
-			 * @error writer-addMarker-marker-exists
+			 * @error writer-addmarker-marker-exists
 			 */
 			throw new CKEditorError( 'writer-addmarker-marker-exists', this );
 		}
@@ -942,12 +944,9 @@ export default class Writer {
 			/**
 			 * Range parameter is required when adding a new marker.
 			 *
-			 * @error writer-addMarker-no-range
+			 * @error writer-addmarker-no-range
 			 */
-			throw new CKEditorError(
-				'writer-addmarker-no-range',
-				this
-			);
+			throw new CKEditorError( 'writer-addmarker-no-range', this );
 		}
 
 		if ( !usingOperation ) {
@@ -1038,7 +1037,7 @@ export default class Writer {
 			/**
 			 * Marker with provided name does not exists.
 			 *
-			 * @error writer-updateMarker-marker-not-exists
+			 * @error writer-updatemarker-marker-not-exists
 			 */
 			throw new CKEditorError( 'writer-updatemarker-marker-not-exists', this );
 		}
@@ -1059,12 +1058,9 @@ export default class Writer {
 			/**
 			 * One of the options is required - provide range, usingOperations or affectsData.
 			 *
-			 * @error writer-updateMarker-wrong-options
+			 * @error writer-updatemarker-wrong-options
 			 */
-			throw new CKEditorError(
-				'writer-updatemarker-wrong-options',
-				this
-			);
+			throw new CKEditorError( 'writer-updatemarker-wrong-options', this );
 		}
 
 		const currentRange = currentMarker.getRange();
@@ -1112,7 +1108,7 @@ export default class Writer {
 			/**
 			 * Trying to remove marker which does not exist.
 			 *
-			 * @error writer-removeMarker-no-marker
+			 * @error writer-removemarker-no-marker
 			 */
 			throw new CKEditorError( 'writer-removemarker-no-marker', this );
 		}

+ 2 - 5
packages/ckeditor5-engine/src/view/position.js

@@ -356,12 +356,9 @@ export default class Position {
 				 * {@link module:engine/view/view~View#createPositionAt `View#createPositionAt()`}
 				 * requires the offset to be specified when the first parameter is a view item.
 				 *
-				 * @error view-createPositionAt-offset-required
+				 * @error view-createpositionat-offset-required
 				 */
-				throw new CKEditorError(
-					'view-createpositionat-offset-required',
-					node
-				);
+				throw new CKEditorError( 'view-createpositionat-offset-required', node );
 			}
 
 			return new Position( node, offset );

+ 1 - 1
packages/ckeditor5-engine/src/view/renderer.js

@@ -150,7 +150,7 @@ export default class Renderer {
 				/**
 				 * Unknown type passed to Renderer.markToSync.
 				 *
-				 * @error renderer-unknown-type
+				 * @error view-renderer-unknown-type
 				 */
 				throw new CKEditorError( 'view-renderer-unknown-type', this );
 			}

+ 5 - 11
packages/ckeditor5-engine/src/view/selection.js

@@ -497,12 +497,9 @@ export default class Selection {
 				/**
 				 * selection.setTo requires the second parameter when the first parameter is a node.
 				 *
-				 * @error view-selection-setTo-required-second-parameter
+				 * @error view-selection-setto-required-second-parameter
 				 */
-				throw new CKEditorError(
-					'view-selection-setto-required-second-parameter',
-					this
-				);
+				throw new CKEditorError( 'view-selection-setto-required-second-parameter', this );
 			} else if ( placeOrOffset == 'in' ) {
 				range = Range._createIn( selectable );
 			} else if ( placeOrOffset == 'on' ) {
@@ -522,7 +519,7 @@ export default class Selection {
 			/**
 			 * Cannot set selection to given place.
 			 *
-			 * @error view-selection-setTo-not-selectable
+			 * @error view-selection-setto-not-selectable
 			 */
 			throw new CKEditorError( 'view-selection-setto-not-selectable', this );
 		}
@@ -546,12 +543,9 @@ export default class Selection {
 			/**
 			 * Cannot set selection focus if there are no ranges in selection.
 			 *
-			 * @error view-selection-setFocus-no-ranges
+			 * @error view-selection-setfocus-no-ranges
 			 */
-			throw new CKEditorError(
-				'view-selection-setfocus-no-ranges',
-				this
-			);
+			throw new CKEditorError( 'view-selection-setfocus-no-ranges', this );
 		}
 
 		const newFocus = Position._createAt( itemOrPosition, offset );

+ 6 - 5
packages/ckeditor5-engine/src/view/treewalker.js

@@ -49,11 +49,12 @@ export default class TreeWalker {
 		}
 
 		if ( options.direction && options.direction != 'forward' && options.direction != 'backward' ) {
-			throw new CKEditorError(
-				'view-tree-walker-unknown-direction',
-				options.startPosition,
-				{ direction: options.direction }
-			);
+			/**
+			 * Only `backward` and `forward` direction allowed.
+			 *
+			 * @error view-tree-walker-unknown-direction
+			 */
+			throw new CKEditorError( 'view-tree-walker-unknown-direction', options.startPosition, { direction: options.direction } );
 		}
 
 		/**

+ 2 - 0
packages/ckeditor5-engine/tests/model/model.js

@@ -339,6 +339,7 @@ describe( 'Model', () => {
 		it( 'should throw the original CKEditorError error if it was thrown inside the `change()` block', () => {
 			expectToThrowCKEditorError( () => {
 				model.change( () => {
+					// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
 					throw new CKEditorError( 'foo', null, { foo: 1 } );
 				} );
 			}, /foo/, null, { foo: 1 } );
@@ -355,6 +356,7 @@ describe( 'Model', () => {
 		} );
 
 		it( 'should throw the original CKEditorError error if it was thrown inside the `enqueueChange()` block', () => {
+			// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
 			const err = new CKEditorError( 'foo', null, { foo: 1 } );
 
 			expectToThrowCKEditorError( () => {

+ 1 - 0
packages/ckeditor5-engine/tests/view/view/view.js

@@ -904,6 +904,7 @@ describe( 'view', () => {
 		it( 'should rethrow custom CKEditorError errors', () => {
 			expectToThrowCKEditorError( () => {
 				view.change( () => {
+					// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
 					throw new CKEditorError( 'foo', view );
 				} );
 			}, /foo/, view );

+ 2 - 5
packages/ckeditor5-ui/src/view.js

@@ -461,12 +461,9 @@ export default class View {
 			/**
 			 * This View has already been rendered.
 			 *
-			 * @error ui-view-render-rendered
+			 * @error ui-view-render-already-rendered
 			 */
-			throw new CKEditorError(
-				'ui-view-render-already-rendered',
-				this
-			);
+			throw new CKEditorError( 'ui-view-render-already-rendered', this );
 		}
 
 		// Render #element of the view.

+ 11 - 4
packages/ckeditor5-upload/src/filerepository.js

@@ -432,6 +432,11 @@ class FileLoader {
 	 */
 	read() {
 		if ( this.status != 'idle' ) {
+			/**
+			 * You cannot call read if the status is different than idle.
+			 *
+			 * @error filerepository-read-wrong-status
+			 */
 			throw new CKEditorError( 'filerepository-read-wrong-status', this );
 		}
 
@@ -483,10 +488,12 @@ class FileLoader {
 	 */
 	upload() {
 		if ( this.status != 'idle' ) {
-			throw new CKEditorError(
-				'filerepository-upload-wrong-status',
-				this
-			);
+			/**
+			 * You cannot call upload if the status is different than idle.
+			 *
+			 * @error filerepository-upload-wrong-status
+			 */
+			throw new CKEditorError( 'filerepository-upload-wrong-status', this );
 		}
 
 		this.status = 'uploading';

+ 1 - 1
packages/ckeditor5-utils/src/collection.js

@@ -204,7 +204,7 @@ export default class Collection {
 			 * The `index` passed to {@link module:utils/collection~Collection#addMany `Collection#addMany()`}
 			 * is invalid. It must be a number between 0 and the the collection's length.
 			 *
-			 * @error collection-add-item-bad-index
+			 * @error collection-add-item-invalid-index
 			 */
 			throw new CKEditorError( 'collection-add-item-invalid-index', this );
 		}

+ 1 - 1
packages/ckeditor5-utils/src/focustracker.js

@@ -80,7 +80,7 @@ export default class FocusTracker {
 			/**
 			 * This element is already tracked by {@link module:utils/focustracker~FocusTracker}.
 			 *
-			 * @error focusTracker-add-element-already-exist
+			 * @error focustracker-add-element-already-exist
 			 */
 			throw new CKEditorError( 'focustracker-add-element-already-exist', this );
 		}

+ 2 - 5
packages/ckeditor5-utils/src/keyboard.js

@@ -57,13 +57,10 @@ export function getCode( key ) {
 			/**
 			 * Unknown key name. Only key names contained by the {@link module:utils/keyboard~keyCodes} can be used.
 			 *
-			 * @errror keyboard-unknown-key
+			 * @error keyboard-unknown-key
 			 * @param {String} key
 			 */
-			throw new CKEditorError(
-				'keyboard-unknown-key',
-				null, { key }
-			);
+			throw new CKEditorError( 'keyboard-unknown-key', null, { key } );
 		}
 	} else {
 		keyCode = key.keyCode +

+ 2 - 5
packages/ckeditor5-utils/src/observablemixin.js

@@ -380,12 +380,9 @@ function bindTo( ...args ) {
 		/**
 		 * Binding multiple observables only possible with callback.
 		 *
-		 * @error observable-bind-no-callback
+		 * @error observable-bind-to-no-callback
 		 */
-		throw new CKEditorError(
-			'observable-bind-to-no-callback',
-			this
-		);
+		throw new CKEditorError( 'observable-bind-to-no-callback', this );
 	}
 
 	// Eliminate A.bind( 'x', 'y' ).to( B, callback )

+ 2 - 0
packages/ckeditor5-utils/tests/ckeditorerror.js

@@ -3,6 +3,8 @@
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
+/* eslint-disable ckeditor5-rules/ckeditor-error-message */
+
 import { default as CKEditorError, DOCUMENTATION_URL } from '../src/ckeditorerror';
 import { expectToThrowCKEditorError } from './_utils/utils';
 

+ 1 - 0
packages/ckeditor5-utils/tests/emittermixin.js

@@ -158,6 +158,7 @@ describe( 'EmitterMixin', () => {
 
 		it( 'should rethrow the CKEditorError error', () => {
 			emitter.on( 'test', () => {
+				// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
 				throw new CKEditorError( 'foo', null );
 			} );