diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..88dfc81cb1 --- /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 0000000000..a95c4fad74 --- /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: iZjTlmSDEgnr+pJ7qfaLdU6b9yBNzcCi11RIiTmc1LyF+10tyPXQogAV/h3onhdDueZvzIw2eQ3jyVXuQVEgNJB0ruId+xAK2dliuWSC0L5dx/ln3dlubOsQiS/mKUFtJLXhgczs5gLjUjyzOqnYSmgleLn0vQ3Rxie0qb23NeNam8Dxwen9Lpns1u83OdYbaftJfgEDloNxaCCnidoNisXzMO5fNccFokjBwBh/O0f/V+zfIR5ATnQ06UdHxfBdoB2dyVTqMt8ctUTHqMTH3IGY+fubithRgU5tLBm3iP4wfx2YkH/ng6LwJBVZDtq/6ny7N+NEUDPPsNE6kZ+InOmHi3fiEdTi/JQhZEtfA9U6bCJfzE/BBhP46HlDoYJwYbsrJsSBU2mTRJI3o48NCfosUuglvp7mXnpDLgDXezY62UyGLbCUk+F/jiA7qz7NvH7kdjSK9FloyNNL6ODVBL85UrQIMvHLLoVciN9OWYyNjwfMOvJFScv+7GX3JIL9H3ArYOfDnd1uUhZARNo+WIeRlrSKydyJa+CQebwNTnTbT7vTtX5i6cJzttkjkxe4kTYWhhQLiQCwwtX6ABSiNhJn+9gBHYac1yFWL06Ireop8NvWXNqni8f1HZrdqg+xEwRdqju0lSThizVW+Ioulb7H1cYJhbKXlT1w1xLlxIU= + - secure: Ww8ia+iA1REyGQRatUB42jjegFgBozSdvxLMLVKveCarc1p7/hUmurhdZtaNoePwDayAa4fVNaSdTE899mrezpvP0pNK8pwB4+/RplycRMshNh/aDMxyl/Puy3EAEGSUx3x9BxuF8UFWHok5dNzgtxoFWUoMUxJ+0xH/rcQXRGKzYUnFWGBzsyEn5A0k/HV0RLINM4veYWwcl/0JxOIx8cqa+ZRu0VWfnDf84z6Yy/pncXjcm1LZ0PYQ7f89bULUyxRnpSbg09Mx2hV7eZlZQPfEsJB48Ti5veHKA0Xos6180+0MV9Iiu6hkax0mP1H+1tv9Le8nGMViFEQHpo1/Dkkjyg/EvEmkSs4CRVcEBSgAEU4O6T+OJ+djgllGy+bTIDiwAmvijQ1B7SWiN8Qg39KQ8wcJSfK1uFkwE9QT9DhOEDVVLsoEulkshdUw32ANNRglvenuS3mxKNPWXNpIsvliqDvXA4HJ8lH2aJnPH2th+8s4P9nxyqF5nW8U0ee78z4ilRy0vDtJaVm/nhiyghRL9tdCifcsOpeJDrluOURFyWQlp7ltB9Q0/psCMQusyg0mYpnyf9Aai7AAWB1yx4ra97SLRBNEF66DpBx/Gnw4TYKQLyh6VZWHt9Im9MCVoaAqUY3FTLl06sq8d2/DRYoxHEPN1K3Wqol0viktg3g= diff --git a/package.json b/package.json index 72d8924d06..1513519a85 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 9176d5f608..fc4854f164 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 ClassicEditor = require( '../../build/ckeditor' ); ClassicEditor.create( document.querySelector( '#editor' ) ) diff --git a/tests/manual/ckeditor.js b/tests/manual/ckeditor.js index bd83687ec8..3f98169188 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 ClassicEditor from '../../build/ckeditor'; ClassicEditor.create( document.querySelector( '#editor' ) )