Przeglądaj źródła

Merge pull request #16 from ckeditor/t/ckeditor5/1236

Internal: Introduced ESLint and Travis. See ckeditor/ckeditor5#1236.
Aleksander Nowodzinski 7 lat temu
rodzic
commit
88c09890fc

+ 12 - 0
packages/ckeditor5-build-decoupled-document/.eslintrc.js

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

Plik diff jest za duży
+ 31 - 0
packages/ckeditor5-build-decoupled-document/.travis.yml


+ 16 - 1
packages/ckeditor5-build-decoupled-document/package.json

@@ -48,6 +48,10 @@
     "@ckeditor/ckeditor5-table": "^11.0.1",
     "@ckeditor/ckeditor5-theme-lark": "^12.0.0",
     "@ckeditor/ckeditor5-upload": "^10.0.4",
+    "eslint": "^5.5.0",
+    "eslint-config-ckeditor5": "^1.0.7",
+    "husky": "^0.14.3",
+    "lint-staged": "^7.0.0",
     "postcss-loader": "^3.0.0",
     "raw-loader": "^1.0.0",
     "style-loader": "^0.23.0",
@@ -69,6 +73,17 @@
   },
   "scripts": {
     "build": "webpack --mode production",
+    "lint": "eslint --quiet '**/*.js'",
+    "precommit": "lint-staged",
     "preversion": "npm run build; if [ -n \"$(git status src/ckeditor.js build/ --porcelain)\" ]; then git add -u src/ckeditor.js build/ && git commit -m 'Internal: Build.'; fi"
-  }
+  },
+  "lint-staged": {
+    "**/*.js": [
+      "eslint --quiet"
+    ]
+  },
+  "eslintIgnore": [
+    "build/**",
+    "packages/**"
+  ]
 }

+ 3 - 0
packages/ckeditor5-build-decoupled-document/tests/manual/ckeditor-cjs-version.js

@@ -3,6 +3,9 @@
  * For licensing, see LICENSE.md.
  */
 
+/* eslint-env commonjs */
+/* globals window, document, console */
+
 const DecoupledEditor = require( '../../build/ckeditor' );
 
 DecoupledEditor.create( document.querySelector( '#editor' ) )

+ 2 - 0
packages/ckeditor5-build-decoupled-document/tests/manual/ckeditor.js

@@ -3,6 +3,8 @@
  * For licensing, see LICENSE.md.
  */
 
+/* globals window, document, console */
+
 import DecoupledEditor from '../../build/ckeditor';
 
 DecoupledEditor.create( document.querySelector( '#editor' ) )