From: Alexander Moisseev Date: Tue, 3 Jul 2018 08:24:40 +0000 (+0300) Subject: [Test] Add JavaScript linting X-Git-Tag: 1.7.8~45^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F2322%2Fhead;p=rspamd.git [Test] Add JavaScript linting --- diff --git a/.circleci/config.yml b/.circleci/config.yml index 51525aae0..400029d69 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -119,11 +119,29 @@ jobs: - run: (exit $RETURN_CODE) + eslint: + docker: + - image: circleci/node:latest + steps: + - checkout + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + - run: npm install + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package.json" }} + - run: ./node_modules/.bin/eslint ./ + workflows: version: 2 build-and-test: jobs: - build + - eslint - rspamd-test: requires: - build diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..64c25a22c --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,8 @@ +{ + "env": { + "browser": true + }, + "rules": { + "newline-per-chained-call": "off" + } +} diff --git a/package.json b/package.json new file mode 100644 index 000000000..14ee2bd7b --- /dev/null +++ b/package.json @@ -0,0 +1,6 @@ +{ + "devDependencies": { + "eslint": "*" + }, + "eslintIgnore": ["*.min.js", "interface/js/lib/domReady.js"] +}