Procházet zdrojové kódy

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

Internal: Introduced ESLint and Travis. See ckeditor/ckeditor5#1236.
Aleksander Nowodzinski před 7 roky
rodič
revize
4a336fb89f

+ 12 - 0
packages/ckeditor5-build-inline/.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'
+};

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 31 - 0
packages/ckeditor5-build-inline/.travis.yml


+ 16 - 1
packages/ckeditor5-build-inline/package.json

@@ -45,6 +45,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",
@@ -66,6 +70,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-inline/tests/manual/ckeditor-cjs-version.js

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

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

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