浏览代码

Code style: Aligned code style to new ESLint version.

Kamil Piechaczek 8 年之前
父节点
当前提交
9a2cdd9aab

+ 32 - 29
packages/ckeditor5-autoformat/tests/autoformat.js

@@ -26,14 +26,15 @@ describe( 'Autoformat', () => {
 	let editor, doc, batch;
 
 	beforeEach( () => {
-		return VirtualTestEditor.create( {
-			plugins: [ Enter, Paragraph, Autoformat, ListEngine, HeadingEngine, BoldEngine, ItalicEngine, BlockQuoteEngine ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			doc = editor.document;
-			batch = doc.batch();
-		} );
+		return VirtualTestEditor
+			.create( {
+				plugins: [ Enter, Paragraph, Autoformat, ListEngine, HeadingEngine, BoldEngine, ItalicEngine, BlockQuoteEngine ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				doc = editor.document;
+				batch = doc.batch();
+			} );
 	} );
 
 	afterEach( () => {
@@ -243,9 +244,10 @@ describe( 'Autoformat', () => {
 
 	describe( 'without commands', () => {
 		beforeEach( () => {
-			return VirtualTestEditor.create( {
-				plugins: [ Enter, Paragraph, Autoformat ]
-			} )
+			return VirtualTestEditor
+				.create( {
+					plugins: [ Enter, Paragraph, Autoformat ]
+				} )
 				.then( newEditor => {
 					editor = newEditor;
 					doc = editor.document;
@@ -326,26 +328,27 @@ describe( 'Autoformat', () => {
 		} );
 
 		it( 'should use only configured headings', () => {
-			return VirtualTestEditor.create( {
-				plugins: [ Enter, Paragraph, Autoformat, ListEngine, HeadingEngine ],
-				heading: {
-					options: [
-						{ modelElement: 'paragraph' },
-						{ modelElement: 'heading1', viewElement: 'h2' }
-					]
-				}
-			} )
-			.then( editor => {
-				doc = editor.document;
-				batch = doc.batch();
+			return VirtualTestEditor
+				.create( {
+					plugins: [ Enter, Paragraph, Autoformat, ListEngine, HeadingEngine ],
+					heading: {
+						options: [
+							{ modelElement: 'paragraph' },
+							{ modelElement: 'heading1', viewElement: 'h2' }
+						]
+					}
+				} )
+				.then( editor => {
+					doc = editor.document;
+					batch = doc.batch();
 
-				setData( doc, '<paragraph>##[]</paragraph>' );
-				doc.enqueueChanges( () => {
-					batch.insert( doc.selection.getFirstPosition(), ' ' );
-				} );
+					setData( doc, '<paragraph>##[]</paragraph>' );
+					doc.enqueueChanges( () => {
+						batch.insert( doc.selection.getFirstPosition(), ' ' );
+					} );
 
-				expect( getData( doc ) ).to.equal( '<paragraph>## []</paragraph>' );
-			} );
+					expect( getData( doc ) ).to.equal( '<paragraph>## []</paragraph>' );
+				} );
 		} );
 	} );
 } );

+ 9 - 8
packages/ckeditor5-autoformat/tests/blockautoformatengine.js

@@ -17,14 +17,15 @@ describe( 'BlockAutoformatEngine', () => {
 	let editor, doc, batch;
 
 	beforeEach( () => {
-		return VirtualTestEditor.create( {
-			plugins: [ Enter, Paragraph ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			doc = editor.document;
-			batch = doc.batch();
-		} );
+		return VirtualTestEditor
+			.create( {
+				plugins: [ Enter, Paragraph ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				doc = editor.document;
+				batch = doc.batch();
+			} );
 	} );
 
 	describe( 'Command name', () => {

+ 10 - 9
packages/ckeditor5-autoformat/tests/inlineautoformatengine.js

@@ -16,15 +16,16 @@ describe( 'InlineAutoformatEngine', () => {
 	let editor, doc, batch;
 
 	beforeEach( () => {
-		return VirtualTestEditor.create( {
-			plugins: [ Enter, Paragraph ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			doc = editor.document;
-			batch = doc.batch();
-			doc.schema.allow( { name: '$inline', attributes: [ 'testAttribute' ] } );
-		} );
+		return VirtualTestEditor
+			.create( {
+				plugins: [ Enter, Paragraph ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				doc = editor.document;
+				batch = doc.batch();
+				doc.schema.allow( { name: '$inline', attributes: [ 'testAttribute' ] } );
+			} );
 	} );
 
 	describe( 'attribute', () => {

+ 11 - 10
packages/ckeditor5-autoformat/tests/manual/autoformat.js

@@ -17,13 +17,14 @@ import Undo from '@ckeditor/ckeditor5-undo/src/undo';
 import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ Enter, Typing, Paragraph, Undo, Bold, Italic, Heading, List, Autoformat, BlockQuote ],
-	toolbar: [ 'headings', 'numberedList', 'bulletedList', 'blockQuote', 'bold', 'italic', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ Enter, Typing, Paragraph, Undo, Bold, Italic, Heading, List, Autoformat, BlockQuote ],
+		toolbar: [ 'headings', 'numberedList', 'bulletedList', 'blockQuote', 'bold', 'italic', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );