Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Fixed linter issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
ma2ciek committed Jul 1, 2019
1 parent b9d8c32 commit 6762063
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
5 changes: 4 additions & 1 deletion src/model/nodelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ export default class NodeList {
*
* @error nodelist-insertNodes-not-node
*/
throw new CKEditorError( 'model-nodelist-insertNodes-not-node: Trying to insert an object which is not a Node instance.', this);
throw new CKEditorError(
'model-nodelist-insertNodes-not-node: Trying to insert an object which is not a Node instance.',
this
);
}
}

Expand Down
10 changes: 8 additions & 2 deletions src/model/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,10 @@ export default class Schema {
*
* @error schema-check-merge-no-element-before
*/
throw new CKEditorError( 'schema-check-merge-no-element-before: The node before the merge position must be an element.', this );
throw new CKEditorError(
'schema-check-merge-no-element-before: The node before the merge position must be an element.',
this
);
}

if ( !( nodeAfter instanceof Element ) ) {
Expand All @@ -365,7 +368,10 @@ export default class Schema {
*
* @error schema-check-merge-no-element-after
*/
throw new CKEditorError( 'schema-check-merge-no-element-after: The node after the merge position must be an element.', this );
throw new CKEditorError(
'schema-check-merge-no-element-after: The node after the merge position must be an element.',
this
);
}

return this.checkMerge( nodeBefore, nodeAfter );
Expand Down
5 changes: 4 additions & 1 deletion src/model/treewalker.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ export default class TreeWalker {
*
* @error model-tree-walker-no-start-position
*/
throw new CKEditorError( 'model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.', this );
throw new CKEditorError(
'model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.',
null
);
}

const direction = options.direction || 'forward';
Expand Down
8 changes: 3 additions & 5 deletions tests/controller/datacontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,15 @@ describe( 'DataController', () => {
it( 'should throw an error when non-existent root is used (single)', () => {
expectToThrowCKEditorError( () => {
data.init( { nonexistent: '<p>Bar</p>' } );
},
'datacontroller-init-non-existent-root: Attempting to init data on a non-existing root.'
);
}, /^datacontroller-init-non-existent-root:/ );
} );

it( 'should throw an error when non-existent root is used (one of many)', () => {
schema.extend( '$text', { allowIn: '$root' } );

expectToThrowCKEditorError( () => {
data.init( { main: 'bar', nonexistent: '<p>Bar</p>' } );
}, /datacontroller-init-non-existent-root:/, model );
}, /^datacontroller-init-non-existent-root:/, model );

expect( getData( model, { withoutSelection: true } ) ).to.equal( '' );
} );
Expand Down Expand Up @@ -319,7 +317,7 @@ describe( 'DataController', () => {

expectToThrowCKEditorError( () => {
data.set( { main: 'bar', nonexistent: '<p>Bar</p>' } );
}, /datacontroller-set-non-existent-root:/, model )
}, /datacontroller-set-non-existent-root:/, model );

expect( getData( model, { withoutSelection: true } ) ).to.equal( 'foo' );
} );
Expand Down
1 change: 1 addition & 0 deletions tests/conversion/upcastdispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import ModelRange from '../../src/model/range';
import ModelWriter from '../../src/model/writer';

import first from '@ckeditor/ckeditor5-utils/src/first';
import { expectToThrowCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';

describe( 'UpcastDispatcher', () => {
let model;
Expand Down
1 change: 0 additions & 1 deletion tests/view/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import Node from '../../src/view/node';
import DocumentFragment from '../../src/view/documentfragment';
import RootEditableElement from '../../src/view/rooteditableelement';


import createDocumentMock from '../../tests/view/_utils/createdocumentmock';
import { expectToThrowCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';

Expand Down

0 comments on commit 6762063

Please sign in to comment.