Browse Source

Merge branch 'master' into t/42

Piotrek Koszuliński 8 years ago
parent
commit
527fc988c3

+ 12 - 0
packages/ckeditor5-basic-styles/.eslintrc.js

@@ -0,0 +1,12 @@
+/**
+ * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* eslint-env node */
+
+'use strict';
+
+module.exports = {
+	extends: 'ckeditor5'
+};

+ 0 - 92
packages/ckeditor5-basic-styles/.jscsrc

@@ -1,92 +0,0 @@
-{
-  "requireCurlyBraces": [
-    "if",
-    "else",
-    "for",
-    "while",
-    "do",
-    "switch",
-    "try",
-    "catch"
-  ],
-  "requireSpaceBeforeKeywords": true,
-  "requireSpaceAfterKeywords": [
-    "do",
-    "for",
-    "if",
-    "else",
-    "switch",
-    "case",
-    "try",
-    "catch",
-    "void",
-    "while",
-    "with",
-    "return",
-    "typeof"
-  ],
-  "requireSpaceBeforeBlockStatements": true,
-  "requireParenthesesAroundIIFE": true,
-  "requireSpacesInConditionalExpression": {
-    "afterTest": true,
-    "beforeConsequent": true,
-    "afterConsequent": true,
-    "beforeAlternate": true
-  },
-  "requireSpacesInFunction": {
-    "beforeOpeningCurlyBrace": true
-  },
-  "disallowSpacesInFunction": {
-    "beforeOpeningRoundBrace": true
-  },
-  "disallowSpacesInCallExpression": true,
-  "disallowMultipleVarDecl": "exceptUndefined",
-  "requireBlocksOnNewline": true,
-  "disallowPaddingNewlinesInBlocks": true,
-  "requirePaddingNewlinesBeforeKeywords": [
-    "do",
-    "for",
-    "if",
-    "switch",
-    "case",
-    "try",
-    "while",
-    "with",
-    "return"
-  ],
-  "requireSpacesInsideObjectBrackets": "all",
-  "requireSpacesInsideArrayBrackets": "all",
-  "requireSpacesInsideParentheses": "all",
-  "disallowSpaceAfterObjectKeys": true,
-  "requireSpaceBeforeObjectValues": true,
-  "requireCommaBeforeLineBreak": true,
-  "requireOperatorBeforeLineBreak": true,
-  "disallowSpaceAfterPrefixUnaryOperators": true,
-  "disallowSpaceBeforePostfixUnaryOperators": true,
-  "requireSpaceBeforeBinaryOperators": true,
-  "disallowImplicitTypeConversion": [
-    "numeric",
-    "binary",
-    "string"
-  ],
-  "requireCamelCaseOrUpperCaseIdentifiers": true,
-  "requireSpaceAfterBinaryOperators": true,
-  "disallowKeywords": [
-    "with"
-  ],
-  "disallowMultipleLineStrings": true,
-  "disallowMultipleLineBreaks": true,
-  "disallowMixedSpacesAndTabs": true,
-  "disallowTrailingWhitespace": true,
-  "maximumLineLength": 140,
-  "requireCapitalizedConstructors": true,
-  "requireDotNotation": true,
-  "disallowYodaConditions": true,
-  "disallowNewlineBeforeBlockStatements": true,
-  "validateLineBreaks": "LF",
-  "validateQuoteMarks": "'",
-  "validateIndentation": "\t",
-  "safeContextKeyword": [
-    "that"
-  ]
-}

+ 0 - 11
packages/ckeditor5-basic-styles/.jshintrc

@@ -1,11 +0,0 @@
-{
-  "esnext": true,
-  "immed": true,
-  "loopfunc": true,
-  "noarg": true,
-  "nonbsp": true,
-  "undef": true,
-  "unused": true,
-  "strict": "implied",
-  "varstmt": true
-}

+ 6 - 5
packages/ckeditor5-basic-styles/gulpfile.js

@@ -3,19 +3,20 @@
  * For licensing, see LICENSE.md.
  */
 
-/* jshint browser: false, node: true, strict: true */
+/* eslint-env node */
 
 'use strict';
 
 const gulp = require( 'gulp' );
-const ckeditor5Lint = require( '@ckeditor/ckeditor5-dev-lint' )( {
+const ckeditor5Lint = require( '@ckeditor/ckeditor5-dev-lint' );
+const options = {
 	// Files ignored by `gulp lint` task.
 	// Files from .gitignore will be added automatically during task execution.
 	ignoredFiles: [
 		'src/lib/**'
 	]
-} );
+};
 
-gulp.task( 'lint', ckeditor5Lint.lint );
-gulp.task( 'lint-staged', ckeditor5Lint.lintStaged );
+gulp.task( 'lint', () => ckeditor5Lint.lint( options ) );
+gulp.task( 'lint-staged', () => ckeditor5Lint.lintStaged( options ) );
 gulp.task( 'pre-commit', [ 'lint-staged' ] );

+ 3 - 2
packages/ckeditor5-basic-styles/package.json

@@ -9,7 +9,7 @@
     "@ckeditor/ckeditor5-ui": "^0.9.0"
   },
   "devDependencies": {
-    "@ckeditor/ckeditor5-dev-lint": "^2.0.2",
+    "@ckeditor/ckeditor5-dev-lint": "^3.0.0",
     "@ckeditor/ckeditor5-editor-classic": "^0.7.3",
     "@ckeditor/ckeditor5-enter": "^0.9.1",
     "@ckeditor/ckeditor5-heading": "^0.9.1",
@@ -17,7 +17,8 @@
     "@ckeditor/ckeditor5-typing": "^0.9.1",
     "@ckeditor/ckeditor5-undo": "^0.8.1",
     "@ckeditor/ckeditor5-utils": "^0.9.1",
-    "gulp": "^3.9.0",
+    "eslint-config-ckeditor5": "^1.0.0",
+    "gulp": "^3.9.1",
     "guppy-pre-commit": "^0.4.0"
   },
   "engines": {

+ 1 - 1
packages/ckeditor5-basic-styles/src/bold.js

@@ -44,7 +44,7 @@ export default class Bold extends Plugin {
 		const keystroke = 'CTRL+B';
 
 		// Add bold button to feature components.
-		editor.ui.componentFactory.add( 'bold', ( locale ) => {
+		editor.ui.componentFactory.add( 'bold', locale => {
 			const view = new ButtonView( locale );
 
 			view.set( {

+ 1 - 1
packages/ckeditor5-basic-styles/src/italic.js

@@ -44,7 +44,7 @@ export default class Italic extends Plugin {
 		const keystroke = 'CTRL+I';
 
 		// Add bold button to feature components.
-		editor.ui.componentFactory.add( 'italic', ( locale ) => {
+		editor.ui.componentFactory.add( 'italic', locale => {
 			const view = new ButtonView( locale );
 
 			view.set( {

+ 0 - 22
packages/ckeditor5-basic-styles/tests/.jshintrc

@@ -1,22 +0,0 @@
-{
-  "esnext": true,
-  "expr": true,
-  "immed": true,
-  "loopfunc": true,
-  "noarg": true,
-  "nonbsp": true,
-  "strict": "implied",
-  "undef": true,
-  "unused": true,
-  "varstmt": true,
-  "globals": {
-    "after": false,
-    "afterEach": false,
-    "before": false,
-    "beforeEach": false,
-    "describe": false,
-    "expect": false,
-    "it": false,
-    "sinon": false
-  }
-}

+ 6 - 6
packages/ckeditor5-basic-styles/tests/bold.js

@@ -22,13 +22,13 @@ describe( 'Bold', () => {
 		document.body.appendChild( editorElement );
 
 		return ClassicTestEditor.create( editorElement, {
-				plugins: [ Bold ]
-			} )
-			.then( newEditor => {
-				editor = newEditor;
+			plugins: [ Bold ]
+		} )
+		.then( newEditor => {
+			editor = newEditor;
 
-				boldView = editor.ui.componentFactory.create( 'bold' );
-			} );
+			boldView = editor.ui.componentFactory.create( 'bold' );
+		} );
 	} );
 
 	afterEach( () => {

+ 6 - 6
packages/ckeditor5-basic-styles/tests/boldengine.js

@@ -17,13 +17,13 @@ describe( 'BoldEngine', () => {
 
 	beforeEach( () => {
 		return VirtualTestEditor.create( {
-				plugins: [ Paragraph, BoldEngine ]
-			} )
-			.then( newEditor => {
-				editor = newEditor;
+			plugins: [ Paragraph, BoldEngine ]
+		} )
+		.then( newEditor => {
+			editor = newEditor;
 
-				doc = editor.document;
-			} );
+			doc = editor.document;
+		} );
 	} );
 
 	it( 'should be loaded', () => {

+ 6 - 6
packages/ckeditor5-basic-styles/tests/italic.js

@@ -22,13 +22,13 @@ describe( 'Italic', () => {
 		document.body.appendChild( editorElement );
 
 		return ClassicTestEditor.create( editorElement, {
-				plugins: [ Italic ]
-			} )
-			.then( newEditor => {
-				editor = newEditor;
+			plugins: [ Italic ]
+		} )
+		.then( newEditor => {
+			editor = newEditor;
 
-				italicView = editor.ui.componentFactory.create( 'italic' );
-			} );
+			italicView = editor.ui.componentFactory.create( 'italic' );
+		} );
 	} );
 
 	afterEach( () => {

+ 6 - 6
packages/ckeditor5-basic-styles/tests/italicengine.js

@@ -17,13 +17,13 @@ describe( 'ItalicEngine', () => {
 
 	beforeEach( () => {
 		return VirtualTestEditor.create( {
-				plugins: [ Paragraph, ItalicEngine ]
-			} )
-			.then( newEditor => {
-				editor = newEditor;
+			plugins: [ Paragraph, ItalicEngine ]
+		} )
+		.then( newEditor => {
+			editor = newEditor;
 
-				doc = editor.document;
-			} );
+			doc = editor.document;
+		} );
 	} );
 
 	it( 'should be loaded', () => {