diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..88dfc81c --- /dev/null +++ b/.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' +}; diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..59ddb6e8 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,31 @@ +sudo: required +dist: trusty +addons: + firefox: latest + apt: + sources: + - google-chrome + packages: + - google-chrome-stable +language: node_js +node_js: +- '8' +cache: +- node_modules +branches: + except: + - stable +before_install: +- export DISPLAY=:99.0 +- sh -e /etc/init.d/xvfb start +- npm config set package-lock false +- npm i -g npm@^5.7.1 +install: +- npm install @ckeditor/ckeditor5-dev-tests +- ckeditor5-dev-tests-install-dependencies +script: +- ckeditor5-dev-tests-travis +env: + global: + - secure: FOSfcMoLfECRJ2SD96ZIwuxvnl9D63/z1SIvvEpJM1n99dbJoObfALFEuEHl/XopYRNaZ7VXO4PEnzt+96YaH9SOlnxrQzi53vr1Zm6LX8LUh1ULEd9F2RNVs5AAqEQcbv2W+91APB9ipxvVPpZtYW9TKXf9FEtBQrMfgkaMrBXyyS+1NZ5EgYu78Qy8CSvszUZChZMR3xB6h7RsDOgv7wzpPa9sYbMGrlm5WmzPaVKFuBnuYj7FcMjk3hm6Mt9qj0TtTANAuA2JaPu0g2sDEU6VneKRZQT3QTpC45GNy3/vKgb+36dB+mI90WnIRO5WS/tVzAXf1sNTeWZdyNZFZFqyOJVoCFdHuhz3YdJPtRO4AiN/eIQdV2QkFYFgd90yHoCZgI16tvGhonTS95QT+e/hbTt2XwucmSIDquV5k5QNV/paNERc90kz4eyZOow29hxsBRQa8f9g3IOBCN3UDR8pn41e/oK7l5SFGrpAylcXap3ezToaAcLUuDolyr7UHP3gVJXpn0KBVxAlg/37FH9jMTtnzji6r1YJlduwbcbzTUANywTGs4B4FpNN5fHvOyYRRkDQCQh489jvFDidj6VeT7Ldy/cgbqwrL1yykse5l/q6vyUn8Yke247bVaNDuSds0r/oYypKrq2xCpiigbUa6u6d4Mv3Sah1LkEl9dE= + - secure: QIl38ob/usXnE6M2doZVOGZ9eUIP6DDFSkYZFaHIWelIEWCgpSCxEHEgJ8PtRooKxCFNlTyJWGrxa1J186SZlP3CqpLOed92yF1AMxhj+ua+2GRZvwH0k+K22D4Gkg+O8NvIOQbIl4+Qpc+ZQeHrZI+xjnC7oMiJ11VRHON7+32+o8ymbJxkIuL+GCvzN8JJtXpSMeZdFXlZxNAwoXyrm0lVNgkq8ANWbzg+eLCjHT9ch5AMobOrR5D/PsbMUw/eI2QDIpKKwvgnuGkNdvl05Klm5dgGX4cnhFj3KbRf7KWSm9g7sNjVkaCEgPSG8ipReBGkwW3eBmC4nIh8hDAsNg0XgJG0bt/rAVnQkBOW3Q1XNv05ZP+Ez0dTZ59jLifZItyiQLjEtCxLD834B9gFP9u5FIHuJXVPa2047m6OVds94Lc60x10eK6Si5CTJMe0NEQ6OTIpm8wXqfVYY14TNOOw0tJOy7jAyU8b24EfXk3ACZlZHiUrDtcGzBRdikIsIoNH1V3BAnPIKRKm9JUN6QpkFCK/q/M43x5mMcxAfErqKEV3feJdN41y2RsjaQVr1sFGm1veHqbdF5/pFnBWcnbjer7XSf/KXMmxM4+hRE6mTR8XAw8kC5Vh1SHfjPDSPsuUQWbrdPBnpeKzWI30bFQeAYDpqM6I4ZAyJMJpTmM= diff --git a/package.json b/package.json index e3a3f22a..0a426dd6 100644 --- a/package.json +++ b/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/**" + ] } diff --git a/tests/manual/ckeditor-cjs-version.js b/tests/manual/ckeditor-cjs-version.js index 3bfa1057..b9a700c3 100644 --- a/tests/manual/ckeditor-cjs-version.js +++ b/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' ) ) diff --git a/tests/manual/ckeditor.js b/tests/manual/ckeditor.js index 6e9df647..429a40ea 100644 --- a/tests/manual/ckeditor.js +++ b/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' ) )